Using Spring-AMQP abstraction API, how do you implement work or task queue? I have a single producer and multiple worker consumers. Consumers pickup next item from the queue and processes it. This is supported when you use RabbitMQ client API directly but I don't see any support in Spring-AMQP. Am I missing something here? Is there another way to implement worker queue?
2
votes
1 Answers
2
votes
Have you read the reference documentation?
When configuring multiple listener containers to listen to the same queue, each will compete for messages from that queue - the "work" will be distributed to them by the server.
Also, increasing the concurrency (concurrentConsumers) within a container (from the default 1) will create multiple consumers within each container (with each running on a separate thread).