简体   繁体   中英

RabbitMQ Message Exchange

I have Created a RabbitMQ Producer and a RabbitMQ Consumer....

suppose my producer produces 10 messages. How can i get a particular message from those 10 messages.

I want to know how can i uniquely identify a message and read that or consume that message.

我有一个示例,该示例显示了如何在C#中执行主题队列,这似乎是您在寻找RabbitMQ教程的目标。我也有一个示例,该示例显示了如何使用EventingBasicConsumer来避免在获取消息时出现阻塞RabbitMQ EventingBasicConsumer

There are several ways to do this, but the one I use most is to use a routing key that is unique to the type of message. Consumers, then, bind to that exchange using a specific routing key, which causes messages to go only to those consumers.

If you can avoid it, you should never just dump messages into a single queue and let the consumers sort them out. The routing keys and exchanges are powerful tools made specifically for routing messages. You should leverage that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM