如何在 ZMQ PUB/SUB 中获得转发器的冗余? [英] How get redundancy for forwarder in ZMQ PUB/SUB?
问题描述
我尝试并运行了这个示例.效果很好.
I tried and made run this example. It worked very well.
我可以添加任意数量的发布者或订阅者,一切都将通过转发器进行通信.我担心的是冗余.如果转发器不再响应,则在转发器启动之前什么都不会工作.
I can add as many publishers or subscribers as I want, everything will communicate thanks to the forwarder. My concern is about redundancy. If the forwarder does not respond anymore, nothing's gonna work until forwarder is up.
我找到了一个示例用于 REQ/REP,但不能作为订阅者申请 PUB/SUB.但想法就在这里.
I found an example for REQ/REP, but it can't be applied for PUB/SUB as subscribers. But idea is here.
有没有办法在发布/订阅场景中使用类似的东西?
Is there a way to have something similar in a pub/sub scenario?
谢谢.
推荐答案
首先阅读 this 章节.
在它的开头指出这些可靠性模式由于其广播性质而不适用于 PUB-SUB 模式.因此,您可以设置带外控制/确认/ping 路径,用于查看是否一切正常,或者您可以使用支持这些可靠性测试的 REQ/ROUTER/REP 模式.
In the beginning of it it states that these reliability patterns don't apply to PUB-SUB patterns due to its broadcast nature. So you can either put in a out of band control/ack/ping path that you use to see if everything went ok, or you can use a REQ/ROUTER/REP pattern that supports these reliability tests.
这篇关于如何在 ZMQ PUB/SUB 中获得转发器的冗余?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!