[zeromq-dev] Survey: use of 0MQ request reply

Martin Sustrik sustrik at 250bpm.com
Sun Jun 19 13:04:18 CEST 2011

On 06/19/2011 04:00 AM, Fabien Niñoles wrote:

>> 6. Anything you feel is missing or inadequate in the REQ/REP designs?
>> Please explain with a use case.
> Confusion in the purpose.  REQ/REP, combined with QUEUE devices, seems
> to be a fairly solid end-to-end pattern.  ROUTER/DEALER seems to be
> more low-level stuff, but with a lot of possibilities.  At one point,
> I wonder if libzmq should concentrate in making very nice but basic
> queued sockets and transport (like PUSH, PULL, PUB, PAIR...), and
> leave the higher level patterns (like REQ, REP, SUB, PUB, ) to czmq or
> something in between.  This would allow the higher devices to be more
> robusts without impairing people to go to the lowest level and create
> their own patterns.
> Briefly, if this can kind be described in term of a protocol over a
> ZMTP transport, it probably doesn'nt belong to libzmq but to a higher
> level library.

The separation of "basic" functionality and "pattern" functionality is 
proposed every now and then.

While the idea seems natural, my personal belief is that it won't work. 
Here's my reasoning:

To build patterns on top of basic functionality, you need access to 
quite a lot of underlying functions/events. Connection events, 
disconnection events, queue depths, dropping of pending messages, 
explicit removing peer from the socket, routing to a particular peer, 
signaling POLLIN and POLLOUT etc.

These functions/events have to be made available via API, which will 
over time offer more and more functionality. Ultimately, the API would 
be functionally equivalent to BSD sockets. At that point the "basic" 
layer can be dropped and replaced by BSD sockets. Which will bring us 
from where we wanted to get (BSD sockets + basic messaging layer + 
patterns) to where we are now (BSD sockets + patterns).


More information about the zeromq-dev mailing list