RabbitMQ multiple consumers for same queue

6.8k Views Asked by At

Is it possible to send a message to a queue using topic, and have 2 consumers who will receive and process the same message? Currently i have created 2 consumers who are observing a queue binding with an exchage topic, but the first consumer consumes the message and removes the queue, and the second consumer does not receive the message.

1

There are 1 best solutions below

0
On BEST ANSWER

If you need pub-sub semantics, you should consider to use queue per consumer. That is exactly how AMQP protocol works.

You can borrow some ideas from the official tutorial: https://www.rabbitmq.com/tutorials/tutorial-five-spring-amqp.html