I have a JMS queue. After receiving the message it needs to be stored to DB. Then depending on some condition I want send this message to third party service with fixed rate, so I use throttling.
I have the following route:
from("jms:queue")
.bean(persistingListener)
.choice()
.when(some condition ..)
.throttle(5)
.asyncDelayed()
.bean(thirdPartyServiceClient)
.endChoice();
However, the entire route gets throttled, not the part related to third party service client. I mean, that if I put 100 messages in the queue, only first 5 will be read. So, in this case the processing of messages that don't require third party service get delayed.
Any ideas on how to throttle only on the part related to third party service?
Thanks in advance