RabbitMQ-联合队列与交换联合 [英] RabbitMQ - federated queues Vs exchange federation

查看:244
本文介绍了RabbitMQ-联合队列与交换联合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个兔子集群,并且每当数据库中发生某些更改时,我都会将消息发布到扇出交换中.

对于使用这些更新的某些微服务,我有绑定到此交换的专用队列,并且我最初还为外部客户端设置了专用队列,以便他们可以将其与自己的Rabbit基础架构联合起来并使用每个副本的副本.消息.

现在,我想知道是否允许交换联盟而不是为每个新的外部消费者创建新的专用队列是否会是一个更好的方法,因为会吸引越来越多的用户.

优缺点是什么?

谢谢

解决方案

只要您正确地管理权限,最终决定权就取决于您.您可以先尝试所有变体,然后找到适合您实际需求的东西.

拥有本地队列可能有其优点和缺点:它使最终用户能够以其基础设施或网络问题在某些中断中幸存下来,而这会以磁盘/内存为代价,但是,您可能会限制队列的长度和/或大小./p>

建议您看看广告插件动态铲子.有了本地队列,它可以完成一项不错的工作.

与联盟相比,铲子要简单得多,例如它不会在上游和下游之间同步内容,而只是以可靠的方式将消息从一个队列移到另一个队列.只要您不需要联盟提供的东西,铲铲都是不错的选择.

此外,您可能会发现此q/a很有用(但是,可能有点过时了)- https://stackoverflow.com/a/19357272 .

I have set up a rabbit cluster and I publish messages into a fanout exchange every time something changes in a database.

I have dedicated queues bound to this exchange for some of my microservices that consume these updates and I also originally set up a dedicated queue for an external client so that they can federate it with their own rabbit infrastructure and consume a copy of every message.

Now I'm wondering whether allowing exchange federation rather than creating a new dedicated queue for each new external consumer would be a better approach since more and more users will come.

What are the pros and cons?

Thanks

解决方案

As long as you manage permissions properly, the final decision is up to you. You can give a try to all variants first and find what will fit your actual needs.

Having local queue may have it pros and cons: it allows end-user to survive some outage with their infrastructure or network issue at the cost of your disk/memory, however, you may limit queue length and/or size.

I'd suggest you to take a look at Shovel plugin and Dynamic shovels. With local queue it may server a good job.

Comparing to federation, shovel is much simpler, e.g. it doesn't sync content between upstream and downstream but simply moves message from one queue to another in a reliable manner. As long as you don't need what federation provides, shovel could be a good choice.

Also, you may find this q/a useful (however, it might be a bit outdated) - https://stackoverflow.com/a/19357272.

这篇关于RabbitMQ-联合队列与交换联合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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