socketszeromqpublish-subscribeinproc

ZeroMQ mixed PUB/SUB DEALER/ROUTER pattern


I need to do the following:

I am completely lost whether it can be done in ZeroMQ or not. Obviously if I can use 2 remote ports, that is not an issue, but I fail to understand if my setup can be achieved with some kind of envelope usage in ZeroMQ. Can it be done? Thanks,

Update:

To clarify what I wish to achieve.

Update2:

Actually I could sort it out. What I did:

What bugs me is that it is an overkill if I compare this with a "regular" socket solution, where I could have connected the client with the worker thread DIRECTLY (e.g. worker thread could recv from the socket opened by the client directly), hence I could spare the routing completely.
What am I missing?


Solution

  • There was a discussion on the ZeroMQ mailing list recently about multiplexing multiple services on one TCP socket. The proposed solutions is essentially what you implemented.

    The discussion also mentions Malamute with its brokers which essentially provides a framework based on ZeroMQ which also provides the functionality you need. I haven't had the time to look into it myself, but it looks promising.