RabbitMq 是否进行从交换到队列的循环
我目前正在评估消息队列系统,RabbitMq 似乎是一个不错的候选者,所以我正在深入研究它。
为了提供一点背景信息,我希望有一个交换负载平衡消息发布到多个队列的东西。我不想复制消息,因此扇出交换不是一个选项。
另外,我考虑使用多个队列与一个队列处理与消费者的循环的原因是,我不希望我们的单点故障出现在队列级别。
听起来我可以在发布者端添加一些逻辑,通过编辑路由键并放置适当的绑定来模拟该行为。但这是一种被动方法,不会考虑每个队列上的消息消耗速度,如果该队列的使用者应用程序已死亡,则可能会导致填满一个队列。
我一直在从交换实体方面寻找一种更主动的方法,该方法将根据每个队列大小或类似性质的东西来决定将下一条消息发送到哪里。
我读到了 Alice 和可用的 RESTful API,但这似乎是实现快速路由决策的重型解决方案。
有人知道交换队列之间的循环是否可以通过 RabbitMQ 实现吗?谢谢。
I am currently evaluating message queue systems and RabbitMq seems like a good candidate, so I'm digging a little more into it.
To give a little context I'm looking to have something like one exchange load balancing the message publishing to multiple queues. I don't want to replicate the messages, so a fanout exchange is not an option.
Also the reason I'm thinking of having multiple queues vs one queue handling the round-robin w/ the consumers, is that I don't want our single point of failure to be at the queue level.
Sounds like I could add some logic on the publisher side to simulate that behavior by editing the routing key and having the appropriate bindings in place. But that's kind of a passive approach that wouldn't take the pace of the message consumption on each queue into account, potentially leading to fill up one queue if the consumer applications for that queue are dead.
I was looking for a more pro-active way from the exchange entity side, that would decide where to send the next message based on each queue size or something of that nature.
I read about Alice and the available RESTful APIs but that seems kind of a heavy duty solution to implement fast routing decisions.
Anyone knows if round-robin between the exchange the queues is feasible w/ RabbitMQ then? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 AMQP 模型中,交换通常是无状态的,尽管最近在有状态交换方面进行了一些实验,因为现在既有用于管理 RabbitMQ 插件的系统,也有用于提供新的实验交换类型的系统。
我认为没有什么可以完全满足您的要求,尽管我不完全确定我理解该要求。除了单点故障之外,使用单个队列并让工作人员从中读取数据是否可以解决您的问题?如果是这样,那么您的问题就简化为在允许您使用该解决方案的 HA 配置中配置 RabbitMQ。有几种方法可以做到这一点:要么使用 HALinux 和共享存储来获得具有快速故障转移的主动/被动 HA,要么设置多个并行代理并在客户端上进行重复数据删除,也许使用 redis 或类似的方法来实现这一点。
我建议在rabbitmq-discuss邮件列表上再次提出你的问题,在那里更多的人将能够提供建议,并且讨论可以被存档以供后代使用。
Exchanges are generally stateless in the AMQP model, though there have been some recent experiments in stateful exchanges now that there's both a system for managing RabbitMQ plugins and for providing new experimental exchange types.
There's nothing that does quite what you want, I don't think, though I'm not completely sure I understand the requirement. Aside from the single-point-of-failure point, would having a single queue with workers reading from it solve your problem? If so, then your problem reduces to configuring RabbitMQ in an HA configuration that permits you to use that solution. There are a couple of approaches to doing that: either use HALinux and a shared store to get active/passive HA with quick failover, or set up more than one parallel broker and deduplicate on the client, perhaps using redis or similar to do so.
I suggest asking your question again on the rabbitmq-discuss mailing list, where more people will be able to offer suggestions, and where the discussion can be archived for posterity.
一致性哈希是一种内置的方式,可以将表单交换共享到队列,但不完全是循环法。又
如何
https://medium.com/@eranda/ rabbitmq-x-consistency-hashing-with-wso2-esb-27479b8d1d21
论文解释一下,它将队列按加权分布放在一个圆上,然后通过发送随机路由密钥将其发送到最近的队列。
http://www8.org/w8-papers/2a-webserver/缓存/paper2.html
One built in way you can do a form of sharing a form exchange to queues, but not exactly round robin, is Consistent Hashing.
rabbitmq_consistent_hash_exchange
How too
https://medium.com/@eranda/rabbitmq-x-consistent-hashing-with-wso2-esb-27479b8d1d21
Paper to explain, it puts queues at a weighted distribution on a circle and then by sending random routing key it will send to the closest queue.
http://www8.org/w8-papers/2a-webserver/caching/paper2.html
同意托尼的方法。
这是 RabbitMQ、Redis 的“混搭”,您可以使用它来代替自己滚动 -
http://xing.github.com/beetle/
Agree with Tony on the approach.
Here is a 'mashup' of RabbitMQ, Redis that you could use instead of rolling your own -
http://xing.github.com/beetle/