Given a queue in ActiveMQ with 50+ consumers, Is there a way to dispatch at the most 1 event per second to consumer? This is to control a flood of events dispatch.
Event producers are outside my application. Hence I need to handle the controlled dispatch from consumers side.
I have a jms prefetch policy configured to as low as 5.
I do not want to dispatch 100's of messages to consumers in a span of few seconds. Instead I want it to be a steady flow.
How do I configure the Queue consumers to dispatch in a controlled flow?
As far as I know, there is no way to throttle the Consumers.
What you can do is to limit the flow to the consumer queue using built in Camel-routes. Maybe you can find a way to use this feature for your case?
vm://localhost?create=false
<include resource="camel.xml"/>
Edit the route in camel.xml to something like this (1msg/1000ms)