Hi,
I'm using SM 3.3 running on Tomcat with Camel 1.6.
In my xbean.xml I have 2 consumer definitions that calls the same provider
definition. One of the routes implements an additional saxon transformation
processing that is required before calling the provider.
REST consumer - Camel --- Saxon
|
SOAP provider
|
SOAP consumer - Camel -----
Now we're trying to add a common throttler component that would apply
different throttle values depending on some value we're expecting from the
request body.
REST consumer - Camel - Saxon ---
| | |
Throttler - SOAP provider
| | |
SOAP consumer - Camel - ------
So at the moment I'm doing this in my Throttler:
from("jbi:service:http://namespace/ThrottlerService")
.choice()
.when().xpath("//role =
''RoleA").to("jbi:service:http://namespace/RoleAService")
.when().xpath("//role =
''RoleB").to("jbi:service:http://namespace/RoleBService")
.end();
from("jbi:service:http://namespace/RoleAService")
.throttler(5).timePeriodMillis(60000).to("jbi:service:http://namespace/TargetService")
from("jbi:service:http://namespace/RoleBService")
.throttler(10).timePeriodMillis(60000).to("jbi:service:http://namespace/TargetService")
from("jbi:service:http://namespace/TargetService")
.choice()
.when().xpath("//request =
'REST").to("jbi:service:http://namespace/SaxonService")
.when().xpath("//request =
''SOAP").to("jbi:service:http://namespace/SOAPService")
.end();
Here's what I observed when I tested this approach:
- If I fire 6 consecutive REST requests for Role A within a 1 minute period,
the 5 requests gets processed fine and the 6th one waited for the next
minute before getting a response. (Expected)
- Similarly if I fire 11 consecutive SOAP requests for Role A within a 1
minute period, the 10 requests gets processed fine and the 11th one waited
for the next minute before getting a response. (Expected)
- If I alternate sending REST and SOAP requests I seem to be able to fire
more than 5 requests for REST and more than 10 requests for SOAP before the
next requests had to wait for the next time slice. (Bad)
- If I fire 6 consecutive REST requests, while the 6th request is waiting
for the next time slice and I fire 1 SOAP request, both the 6th request and
the SOAP request eventually times out. After which any further REST or SOAP
requests are blocked and times out 100% of the time and does not get through
even on the next time slices forcing me to restart my ServiceMix instance.
(Bad)
My questions are:
- How does the throttler behave when set differently for services that
eventually end up calling the same provider endpoint? What's the
recommended approach for this situation? I'd also appreciate any
explainations for those bad behaviors that I've observed above.
Thanks for the help.
--
View this message in context:
http://www.nabble.com/Camel-Throttler-problem-tp25430730p25430730.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.