rabbitmqrabbitmq-exchange

How to push a message on rabbitMQ to all consumers who subscribe to the topic queue, and confirm the consumption after all of them have received it


For example, there are now ten consumers subscribed to the topic exchange. I need to push a message. All ten consumers receive it and consume it only once, and then destroy the message. How can I do that? Only rabbitMQ!!


Solution

  • Please see the tutorial dedicated to how topic exchanges work: https://www.rabbitmq.com/tutorials/tutorial-five-python.html

    You can't guarantee that the consumers will consume the message "only once". Errors can cause re-deliveries among other things. It's rare but it can happen.

    RabbitMQ does not provide any support for confirming that a number of consumers have received and processed a message. You will have to implement that yourself.