[zeromq-dev] Async Server

George Gitau ggitau at ilabafrica.co.ke
Tue Jun 9 22:16:34 CEST 2015

I have implemented a service that utilizes the async server example in the
ZeroMQ book. I am using zmq_proxy with a ROUTER front end and DEALER back
end. I have a bunch of workers connected to this DEALER backend via DEALER
sockets. The core loop in each worker utilises a poller to which i add the
DEALER socket that receives messages fowarded from proxy. That's the basic
architecture of my service.

Another thing to note is that the part with the zmq_proxy call is in its
own thread.(what I call the service core) Also a context object is shared
between the backend dealer socket and all the worker dealer socket
.Communication  uses inproc. To communicate with the service core, i have a
method that utilizes a dealer socket to send a message to the ROUTER socket.

I have come up with two services based on the above architecture.My goal is
to have them communicate with each other. I have managed to do this but
there's a problem. I am initiating two communications from service A to B
but only one goes through. By creating a delay of about 100 milliseconds
between each of the two communications however am able to get them working.
The communication happens between a Worker from service A and the Router
socket on Service B.
What could be going wrong?Why do  I have to delay the sending of the second

*George Gitau,*
*Software Developer,*
*iLab Africa*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150609/394eb7ee/attachment.htm>

More information about the zeromq-dev mailing list