I am new to RabbitMQ. I just started yesterday. I did few spikes on sending and consuming stuff. What I noticed was on their documentation and even on articles that I've read most of them are implementing the subscription piece in a way that they are looping it to get the message from a queue. How can I make it so that it will be event driven? What I wanted to accomplish is when a message is sent to a queue it will raise and event to the receiver and do something about it. Perhaps like displaying the message.
Your reply is greatly appreciated.
Best regards,
Should use EventingBasicConsumer. I have an example on my website that shows how it's used RabbitMQ Events using EventingBasicConsumer
Basically it's just a new consumer that exposes a Received event so you don't need to block.
Some of the examples use that looping style because it's easier to explain and understand.
You want to use IModel.BasicConsume instead of BasicGet
. See the API Guide for examples (search for subscribe and consume).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With