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

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

问题描述

我已经建立了一个兔子集群,每次数据库发生变化时,我都会将消息发布到扇出交换器中.

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.

有什么好处和坏处?

谢谢

推荐答案

只要你妥善管理权限,最终决定权在你.您可以先尝试所有变体,然后找到适合您实际需求的变体.

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.

我建议你看看 Shovel plugin动态铲子.使用本地队列,它可能会很好地完成工作.

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

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

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.

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

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

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

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