[zeromq-dev] sending messages to a specific peer

Pieter Hintjens ph at imatix.com
Mon Dec 27 20:31:08 CET 2010


Read the Guide and specifically, Chapter 3 on custom routing.
On 20 Dec 2010 20:50, "mike castleman" <m at mlcastle.net> wrote:
> hello,
>
> I have an application where the server needs to send occasional messages
> to a specific peer (because the peers control individual, distinct, and
> geographically distributed hardware resources).
>
> The obvious solution is a ZMQ_PUB/ZMQ_SUB pair with a unique topic per
> client, but my understanding is that in such a case the all messages are
> in fact distributed to all subscribers and the filtering happens only on
> the subscriber's side. Given the network topology and limited bandwidth
> of the clients in our application, this is unsuitable.
>
> One solution which may work is to use XREP/XREQ sockets: the client sets
> its identity on connect and then proceeds to ignore the usual REP/REQ
> pattern in favor of just waiting for messages from the server. A minimal
> implementation of this pattern (in Ruby) is at
> <https://gist.github.com/748886>. This seems to work, but it also seems
> like an abuse of XREP/XREQ.
>
> Any thoughts on this problem? Should I use the XREP/XREQ pattern
> described here, or is there something better that I am overlooking? If
> this problem is well-known and has already been discussed, then pointers
> to such previous discussion would be much appreciated.
>
> thanks a lot!
>
> mlc
>
> --
> mike castleman
> mailto:m at mlcastle.net
> tel:+1-646-382-7220
> http://mlcastle.net/
> _______________________________________________
> 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/20101227/738c3dfe/attachment.htm>


More information about the zeromq-dev mailing list