[zeromq-dev] Bidirectional asynchronous communication

Michel Pelletier pelletier.michel at gmail.com
Wed Feb 13 19:58:46 CET 2013

You can multiplex many bidirectional conversations on a DEALER/ROUTER or
DEALER/DEALER socket pair and either side can initiate a conversation.  0mq
does not define what the "conversation" is, just a transport for the
messages.  You will need to keep track of the state of your own
conversation protocol.  A simple approach is to prefix every message with
some kind of conversation id.


On Wed, Feb 13, 2013 at 5:09 AM, Adam Covitch <adam.covitch at gmail.com>wrote:

> Does ZeroMQ support a pattern where a single pair of sockets exist such
> that either side can initiate a message? Also, communication is
> asynchronous? So far the only solution I've found is having two
> REQ/ROUTER/DEALER/REP channels, one in each direction. Asynchrony is
> provided through the use of zmq_poll().  Can this be done using a single
> channel?
> -- Further details --
> I am new to ZeroMQ and messaging in general. Our team is designing a
> messaging framework to fit into a preexisting application model that
> consists multiple applications. The number and type of applications
> dynamically changes, but they are all either servies or user-launched
> applications.
> We would like to use ZeroMQ to enabled communication _among_ our
> applications. I had envisioned a central component that would establish
> communication between the application based on a set of business logic
> rules (i.e. "connect me to the only instance of application X that exists
> in teh same grapphics context as myself"). Communication would then be
> either spun off between the two nodes or continue through the central
> component. We haven't decided yet. But each component (even the central
> component) must be able to both initiate and reply to messages.
> My question is in how to establish the links between each application that
> allows either side to initiate the conversation, and also how to make the
> conversations sufficiently bulletproof such that if one side crashes the
> other side doesn't hang waiting for a reply (I intend to use asynchrony for
> this).
> I was hoping for a full-duplex sort of socket pattern, but I haven't found
> one so far.
> Thank you!
> Adam
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130213/8e66be4d/attachment.html>

More information about the zeromq-dev mailing list