开发者

RabbitMQ Message Exchange

I have Created a RabbitMQ P开发者_JAVA技巧roducer 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.


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.


I have an example that shows how to do a topic queue in C# which appears to be what your looking for RabbitMQ Tutorial I also have one that shows how to use the EventingBasicConsumer to avoid blocking when getting messages RabbitMQ EventingBasicConsumer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜