问题
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.
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?
Thank you.
回答1:
First read this chapter.
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.
来源:https://stackoverflow.com/questions/18345387/how-get-redundancy-for-forwarder-in-zmq-pub-sub