[zeromq-dev] multiplexer pattern

MinRK benjaminrk at gmail.com
Sat Sep 17 07:06:00 CEST 2011


On Fri, Sep 16, 2011 at 17:20, Paul Colomiets <paul at colomiets.name> wrote:

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

ZMQ_GENERIC was renamed to ZMQ_ROUTER.  I am aware that I have to keep track
of identities myself,
but what is not clear is how do I do this in 4.0, now that identities don't
exist.  As I understand it, A socket no longer has the ability to determine
its own identity, so it doesn't know how peers would send it messages.
 Presumably, the ROUTER socket it has connected to is the only object with
this information.

It would seem that this extremely basic pattern in 2.1 has become quite
complicated after the removal of identities.  I imagine that I will just
have to reimplement identity-routing myself on top of the new ROUTER socket,
with a lookup table in the MUX matching the engine-specified identities to
the real routing prefixes, and add extra handshaking to the connection
process to get this information everywhere it needs to be.


>
> --
> Paul
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110916/a147d4e1/attachment.htm>


More information about the zeromq-dev mailing list