Throttle Consumption Level of All JMS Users Listening to ActiveMQ Queue

Using the Camel Throttler component, you can define an upper limit on the speed of messages consumed over a period of time, for example:

from("activemq:queueA").throttle(10).to("direct-vm:bla") 

What I see as not perfect is that Camel Throttler supports exchanges in memory when they are blocked by Throttler. Thus, if you have 100 queue users, and for some reason "direct-vm: bla" is slow (for example, calling an external slow service), you can have up to 100 exchanges in memory!

I was wondering if there is an ActiveMQ feature to put a throttling requirement on the ActiveMQ level. Perhaps even at the queue level. Something like the HornetQ consumer top speed.

0
source share
1 answer

Configure the consumer to use the transaction (it is not necessary to be an XA transaction. If you have only one other endpoint, use a local JMS transaction. See the LLR transaction approach). If the Camel route failed, messages are returned to the broker.

+1
source

All Articles