Reputation: 1175
We are implementing RabbitMQ using Spring-AMQP and our requirement is to run consumer in multiple threads to consume messages from single queue. Is there any server(RabbitMQ) side scripting need to be done or any other ways we can run the multiple threads at consumer level for single queue?
Thanks in advance!
Upvotes: 2
Views: 6853
Reputation: 121177
I guess, it is your answer:
<rabbit:listener-container id="container1" connection-factory="connectionFactory" acknowledge="manual" concurrency="5">
<rabbit:listener id="testListener" queue-names="foo, #{bar.name}" ref="testBean" method="handle"/>
</rabbit:listener-container>
Pay attention to the concurrency attribute. Here is a manual
Upvotes: 5