[zeromq-dev] Advanced request/reply broker pattern

Pieter Hintjens ph at imatix.com
Mon Aug 22 19:58:02 CEST 2011


On Mon, Aug 22, 2011 at 7:25 PM, Zachary Turner <divisortheory at gmail.com> wrote:

> The part that's confusing me is this: Let's say I have one ROUTER socket in
> my server connected to many DEALER sockets on my clients.  We'll number my
> clients from 1-10.  Now suppose my broker decides that it needs to send a
> message to client #7.  How does it do this without ZMQ_IDENTITY?

ZMQ_IDENTITY sets the identity to a fixed, preknown value. However you
don't need that. The DEALER socket will generate a unique identity
when it connects to the ROUTER socket, and the ROUTER will get that
unique identity on all incoming messages. Thus, you always initiate a
dialog with a request from DEALER to ROUTER, with 0..n replies back
from ROUTER to DEALER.

This is actually explained in the Guide, with examples.

-Pieter



More information about the zeromq-dev mailing list