[zeromq-dev] Hanging on client "receive" when a responder goes down in extended request-reply pattern (code in C#)

Chris Whiten chris.whiten at gmail.com
Wed Jan 15 17:29:50 CET 2014

I'm using zeromq in a competing consumer setup, where one process is
pushing data to a set of worker processes to parallelize some data

The publisher publishes data much more quickly than the workers can process
it, so I want the publisher to block when all of the consumers are too
busy.  I'll decide if they're too busy by having them pull data from zeromq
and push them to an in-memory queue on each of the workers, and if that
in-memory queue is too large we temporarily stop accepting messages from

When all of the consumers are too busy, I wish for the client that is
pushing data to the consumers to block, so we don't lose large chunks of
data.  To solve that, I've set up the extended request-reply pattern (as
outlined in Figure 16 of the zeromq guide at
http://zguide.zeromq.org/page:all).  This seems to work in the happy case,
but if a worker goes down the client will never receive a response back
from that worker, and it will hang indefinitely.  Have I selected the wrong
pattern, or is there an easy way to remedy this problem?

My code to test this is at http://pastebin.com/CaZpVayu

Thanks for your help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140115/cebe6e43/attachment.htm>

More information about the zeromq-dev mailing list