[zeromq-dev] 0mq socket multiplexing (or "trunking")

Winston Smith smith.winston.101 at gmail.com
Thu Nov 7 02:49:29 CET 2013

I'm new to 0mq, I have read the book, but could use some advice!  I have
played around with various types of sockets and 0mq seems pretty robust.

I'm looking at using 0mq to replace some existing custom-sockets based
code, basically, we have agents running on various systems that monitor
that apps running on them.  The app has the following messaging patterns:

1) Pub-sub: The agent publishes periodic updates about the system,
subscribers on the server listen and process the notifications.
2) Rep: The server can send requests to the agent, e.g. "ping", or "update"
etc, the agent processes the request and replies.
3) Req: The agent can make requests to the server; the server replies with
a response.

So all of these patterns exist within 0mq, I've prototyped them and they
work nicely.  However, I find I have to set up and allocate
listens/connects for each of these.

Is it possible to "trunk" or multiplex each of these patterns into a single
channel?  I thought perhaps these patterns could actually be implemented
using inproc: with a single dealer socket to the server, there would be a
proxy type thread that would manage the marshaling of the individual inproc
sockets onto the dealer with a corresponding proxy on the server that does
the same.  Obviously, the proxy would also have to manage the message
envelope to ensure that messages get routed appropriately and replies find
their way home.

Also, I'm hoping to use the curve encryption on the dealer socket to
protect the messages in transit (not only for encryption, but

Are there any examples of such a thing?  Or am I stuck with 3 connections


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131106/9753851e/attachment.htm>

More information about the zeromq-dev mailing list