基于 RabbitMQ 消息消费 ID(c# API)
我想发布/生成带有某些消息ID的消息,就像每条消息都有一个特定的ID一样。
在消费者端,我想通过提供ID来检索消息。 假设我们有多个消费者,那么每个消费者应该只获取他们通过消息 ID 请求的消息。 (我希望我足够清楚)。
i would like to publish/produce a message with some message id, like each message has a particular id..
And at the consumer end i would like to retrieve the messages by prividing the ID.
suppose we have multiple consumers than each one should get only those messages which they requested through the message ids. (i hope i am clear enough).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然这不是设计使然,最好使用数据库,但有一种方法可以使用rabbitmq来做到这一点:
使用 id 发布消息:
通过 id 获取消息:
处置
通道
后,所有未确认的消息都将重新排队。Although its not by design and its better to use a database for that there is a way to do this using rabbitmq:
Publish a message with id:
Get a message by id:
After
channel
is disposed all messages that was not acked will requeue.为此,您最好使用数据库。
亚历克西斯(rabbitmq)
You might be better off using a database for this.
alexis (rabbitmq)