Is RabbitMQ capable of “pushing” messages from a queue to a consumer?

后端 未结 4 1056
遥遥无期
遥遥无期 2020-12-17 14:59

With RabbitMQ, is there a way to \"push\" messages from a queue TO a consumer as opposed to having a consumer \"poll and pull\" messages FROM a queue?

This has been

4条回答
  •  旧时难觅i
    2020-12-17 15:36

    You "push" messages from Producer to Exchange.
    https://www.rabbitmq.com/tutorials/tutorial-three-python.html

    BTW this is fitting very well IoT scenarios. Devices produce messages and sends them to an exchange. Queue is handling persistence, FIFO and other features, as well as delivery of messages to subscribers.

    And, by the way, you never "Poll" the queue. Instead, you always subscribe to publisher. Similar to observer pattern. Generally, I would say genius principle. So it is similar to post box or post office, except it sends you a notification when message is available.

提交回复
热议问题