多消费者一个队列 [英] Multiple consumer one queue

查看:100
本文介绍了多消费者一个队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使多个使用者在RabbitMQ中共享一个队列?根据我的观察,我目前正在使用 php库与RabbitMQ一起使用,尽管我有2个相同的消费者脚本实例正在运行,但是只有一个实例会响应所传递的消息...

Is it possible to make multiple consumers to share one single queue in RabbitMQ? I am currently using this php library to work with RabbitMQ, from what I observe, although I have 2 identical instances of a consumer script running, but only one would respond to the message passed...

推荐答案

如果您希望两个使用者都看到所有消息,请给每个使用者自己的(可能是私有的)队列,并将它们都绑定到同一交换机上.

If you want both consumers to see all messages, give each consumer its own (probably private) queue and bind them both to the same exchange.

这篇关于多消费者一个队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆