I have a scenario where a client application sends messages to activeMQ using Spring Integration. I have some processors that consume these messages, but they are not quite fast enough to handle the load. So I want to throttle the client a bit, by assigning a max capacity to the activeMQ queue. When the capacity is reached, the client should simply wait until capacity is available again.
I'm not sure how to achieve this. Let's start with the spring configuration:
Right, so I tried this:
<si:channel id="fromClient" />
<int-jms:outbound-channel-adapter channel="fromClient" destination="fromClientQueue" />
<bean id="fromClientQueue" class="org.apache.activemq.command.ActiveMQQueue">
However, the capacity is ignored and the activeMQ queue is flooded with messages as soon as the client starts.
<si:channel id="fromClient" >
I looked at the ActiveMQQueue class, but found no relevant getters or setters. I also tried in the web interface of activeMQ, but you can only observe the queues there.
What do I do to solve this problem?