[zeromq-dev] multiplexer pattern

Paul Colomiets paul at colomiets.name
Sat Sep 17 02:20:22 CEST 2011

On Fri, Sep 16, 2011 at 11:13 PM, MinRK <benjaminrk at gmail.com> wrote:
> * clients can make requests of particular engines
> * engine replies propagate to requesting client
> * engines and clients can come and go over time (message loss for vanished
> endpoints is fine)
> * clients and engines may not bind, and only connect to the mux and Hub (mux
> also connects to hub)
> IDENTITY made this pattern *extremely* easy, and I don't see the right way
> to build a MUX in its absence.

We have similar setup today, without identities. We use unix sockets
for connections between workers and router, and each worker has unique
socket (actually we have several workers per one named service, which
seems you call engine, but it's not important). It's hard if you have
too much engines. But you can somewhat soften the pain by aggregating
them into groups with an intermediate device (which is similarly to
your router mostly suffles message parts in some way)

With zeromq 4.0 you probably can do similar with ZMQ_GENERIC. But you
need to keep track of identities yourself. This is compensated by the
bonus: you can keep track of several workers per service (engine) and
you can queue messages instead loosing them when there are no workers
available (may be there are other bonuses too).


More information about the zeromq-dev mailing list