How to do non-blocking on RabbitMQ?

I am new to RabbitMQ. I just started yesterday. I made several spikes when sending and consuming things. What I noticed was in their documentation, and even in the articles I read, most of them implement part of the subscription in such a way that they loop it to get the message from the queue. How can I make it so that it is an event? What I wanted to do was when the message is sent to the queue, it will raise the event to the recipient and do something about it. Perhaps as a message display.

Your answer is very welcome.

Yours faithfully,

+7
source share
2 answers

Some of the examples use this style of loop because it is easier to explain and understand.

You want to use IModel.BasicConsume instead of BasicGet . See the API Guide for examples (subscription and consumption searches).

+4
source

Must use EventingBasicConsumer. I have an example on my website that shows how he used RabbitMQ Events using EventingBasicConsumer

This is basically just a new user that provides a Received event, so you don't need to block.

+12
source

All Articles