1

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...

user3666197
  • 1
  • 6
  • 45
  • 89
Cjen1
  • 1,782
  • 2
  • 15
  • 45

1 Answers1

1

Q : how to physically implement it

In case one has never worked with ZeroMQ,
one may here enjoy to first look at "ZeroMQ Principles in less than Five Seconds"
before diving into further details

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 designer likes it to let the show evolve.

Cute, isn't it?

Welcome to the Zen-of-Zero

Alexis Wilke
  • 17,282
  • 10
  • 73
  • 131
user3666197
  • 1
  • 6
  • 45
  • 89
  • So literally just call connect from a subscriber to on each of the publishers addresses? – Cjen1 Oct 30 '19 at 13:17
  • **Roger, exactly that** [ or may similarly let, with legal and mirrored setup & fully functional result, let some `SUB`-s do also their own **`.bind()`** and also let all the respective `PUB`-s **`.connect()`** to This Herd of { Normal | Reversed | Dual-Mode } `SUB`-s ] ...... that's cool either :o) – user3666197 Oct 30 '19 at 15:03