[zeromq-dev] Can a pub-sub endpoint have multiple publishers?

Goswin von Brederlow goswin-v-b at web.de
Tue Apr 15 11:33:38 CEST 2014


On Mon, Apr 14, 2014 at 11:19:40PM +0200, Pieter Hintjens wrote:
> Looking at the ZMQ code will not help you do what you need, though it
> may be useful for other reasons.
> 
> First off, the rules are different if you're using a TCP based pub-sub
> model, vs. a multicast model like PGM (or NORM, I think, but am not
> familiar with that yet).
> 
> Second, if you use e.g. PGM then yes, you can clearly do N-to-N
> publish-subscribe using a single endpoint. Your switch is acting as
> the equivalent of a broker.

Let me see if I got this right (and to summary the thread):

For PGM each node would bind a PUB socket to a predefined multicast
IP:port. Further each node would connect a SUB socket to the same
IP:port. And then any message send to the PUB socket by any node would
reach every other node. Right?

Does that work with EPGM over udp too?

> If you do not want to use a broker and you are using TCP then you can
> interconnect subscribers and publishers. That's doable and fair and
> fast enough.

For TCP binding one PUB socket per node and connecting one SUB socket
per node to every PUB socket is allowed (or vice versa). The only
problem there is managing / detecting all those PUB/SUB sockets to
connect to. So unless the list of nodes is known by all beforehand
some broker is needed.

MfG
	Goswin



More information about the zeromq-dev mailing list