[zeromq-dev] combining REQ/REP Poller with multithreading

Larry White ljw1001 at gmail.com
Sat Feb 21 02:50:33 CET 2015

Hi, and thanks for the wonderful library.

I'm trying to make my REQ/REP app multi-threaded on the server.  I have two
sockets on the server both REP. One is for 'reads', the other 'writes'.

I would like to make reads multithreaded, but keep writes serialized so I
need to distinguish between the types, hence the two REP sockets and the
poller to process them fairly.

I have tried to forward from the Poller to a multithreading ROUTER/DEALER
as shown in the guide, but am doing something wrong. When I create my
queuing proxy between ROUTER and DEALER, the server hangs without an error.
Here is the code.  http://pastebin.com/5KKkvaBi

In the code (snippet shown below) the first println executes and the second
does not.

        System.out.println("About to start");
        ZMQ.proxy(readRouter, readWorkers, null);

Any help would be hugely appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150220/0d5b1d1f/attachment.htm>

More information about the zeromq-dev mailing list