How to do many-to-many pub sub relation

712 Views Asked by At

I have seen it mentioned that ZMQ supports a many-to-many PUB/SUB relation.

In this case what I would like is to have multiple subscribers to multiple publishers, (this is for a common bus style application), however what I am confused about is how to physically implement it since I have also seen it mentioned that there can only be a single bind and multiple connections to that bound socket.

Thus I am slightly confused as to how to achieve this.

I have seen that pgm may be a way to acheive this (since all members would connect to the same multicast address), but I am not sure how to physically do that...

1

There are 1 best solutions below

2
On BEST ANSWER

Q : how to physically implement it

A PUB_A on a Computer A PUB_A.bind()-s, any SUB may .connect() there, onto A

A PUB_B on a Computer B PUB_B.bind()-s, any SUB may .connect() there, onto B

A rev_PUB_C on any host rev_PUB_C.connect()-s to a few or many SUB-s, who've had a previously successful SUB_xyz.bind() onto their respective local address(es)

And the merry-go-round goes on, as the distributed system designer likes it to let the show evolve.