[zeromq-dev] inproc pub/sub socket connection
Chuck Remes
cremes.devlist at mac.com
Thu Nov 18 18:08:28 CET 2010
On Nov 18, 2010, at 11:00 AM, T-zex wrote:
> Thank you Pieter,
>
> We are using 2.0.10, and trying to create a forwarder which forwards
> messages from multiple threads to multiple subscribers. The forwarder
> listens to multiple inproc publishers. This forwarder also implements
> tcp subscriber coordination as described in the guide (through REQ REP
> tcp sockets). Guide also states that sockets shold be created and used
> in the same thread. I am bit confused now how to coordinate iproc
> publishers.
What is the specific confusion? An inproc endpoint can be treated the same as an ipc or tcp endpoint.
Your PUB/SUB forwarder can easily bind to an inproc endpoint *and* a tcp endpoint and do its job. If you ever decide to move one or more publishers out of the process space, the forwarder could bind to multiple inproc and tcp endpoints. The publishers that you moved could then connect to the "incoming" tcp endpoint while the publishers in process space continued to connect to the same inproc endpoint.
Forwarder...
__________________
inproc ---
|
Incoming
|
tcp ------
tcp ------- Outgoing
__________________
My ascii art is probably terrible, but hopefully you get the idea.
The same is true for a queue device used by the REQ/REP coordination sockets.
The lesson here is that a 0mq socket can bind (and connect) to multiple endpoints of varying types.
cr
More information about the zeromq-dev
mailing list