[英]MQTT shared subscriptions to solve the duplicated issue in the distributed system
We build the server to subscribe the topics from another MQTT server.我们构建服务器以从另一个 MQTT 服务器订阅主题。 It works perfectly when we have only one server.当我们只有一台服务器时,它可以完美运行。 However, when we scale it to multiple servers it went wrong.但是,当我们将其扩展到多台服务器时,它就出错了。 Because each of servers receive the same message from the subscription, everything performs multiple times.因为每个服务器都从订阅中接收到相同的消息,所以一切都会执行多次。
MQTT v5 solves this problem, but I have the 2 questions: MQTT v5解决了这个问题,但我有两个问题:
There is also nothing MQTT v5.0 specific about how Shared Subscriptions work, (nothing in the new header space) so there is no reason why it shouldn't work for a v3.1.1 client connecting to a v3.1.1/v5.0 compatible broker that offers the Shared Subscription feature. MQTT v5.0 也没有具体说明共享订阅的工作方式(新标头空间中没有任何内容),因此没有理由为什么它不适用于连接到 v3.1.1/v5.0 的 v3.1.1 客户端提供共享订阅功能的兼容代理。
I can't remember which brokers supported it at v3.1.1 so you will have to check which broker you are using.我不记得在 v3.1.1 中哪些代理支持它,因此您必须检查您使用的是哪个代理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.