Hello all,
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:Code:<si:channel id="fromClient" /> <si:gateway id="echoGateway" service-interface="com.mypackage.EchoGateway" default-request-channel="fromClient" /> <int-jms:outbound-channel-adapter channel="fromClient" destination="fromClientQueue" /> <bean id="fromClientQueue" class="org.apache.activemq.command.ActiveMQQueue"> <constructor-arg value="queue.fromClient"/> </bean>
However, the capacity is ignored and the activeMQ queue is flooded with messages as soon as the client starts.Code:<si:channel id="fromClient" > <si:queue capacity="100"/> </si:channel>
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?


Reply With Quote
