[zeromq-dev] REQ/REP newbie question

Jeremy Selan jeremy.selan at gmail.com
Fri Aug 31 21:21:46 CEST 2012

>From a newbie zmq user...

I am using zmq to stream a series of queries/updates from a user interface
to an underlying data model (using the ipc mechanism).

Some of these messages - representing queries - are
conceptually synchronous where the response is required.  And some of these
messages - the push updates - are asynchronous (where the response value,
an empty buffer, is ignored.

I am currently using a single req/reply pattern for both the queries and
the updates. This is obviously not ideal for performance, as it requires a
needless round-trip for the update messages.

I experimented with using two connections, req/rep along with push/pull,
using the poller to do interleaved handling.  However, while this correctly
models the message handling, the message handling no longer preserves
ordering as it uses two independent sockets.

While I could add a higher level mechanism to replicate the ordering,
the simplicity of using a single zmq socket to preserve inherent message
order is appealing.

Is there a way to do req/rep where you can tell zmq to not expect
reply? (Something like a send flag, "NO_RESPONSE_EXPECTED", for req/rep.)

Is it possible to point both the req/rep and the push/pull at the same
socket to achieve a similar effect, which does preserver ordering?

Or an alternative best practice?


-- Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120831/db724dda/attachment.htm>

More information about the zeromq-dev mailing list