[zeromq-dev] XREP <-> XREP messaging considerations

Torin Sandall torin.sandall at cyaninc.com
Fri Feb 10 06:17:21 CET 2012

Hi All,

I want to implement zeromq-based RPC without an intermediate device. One of
the use cases involves routing RPCs using a consistent hash. I think it's
possible to achieve this using an XREP socket on the client side and
setting up the routing info in the application. I have a couple questions
which fall out of this:

0) Is this a valid configuration? Just be clear, I will have my clients
creating XREP sockets and calling connect specifying the address used by
the servers when they bind their XREP sockets. I plan to have the clients
connecting to multiple endpoints.

1) Does this approach gain anything over having multiple XREQ sockets on
the client side and simply routing RPCs to the appropriate XREQ socket in
the application?

2) I believe I need to communicate the socket identity to the client side
so it can set up the routing information. Is it possible to get the socket
identity on the server side without setting it? The docs say
getsockopt(ZMQ_IDENTITY) returns NULL by default.

3) If I set the identity of the XREP sockets on the server-side should I be
wary about anything? E.g,. do I need to be worrying about resource
exhaustion if I generate a random identity value for the socket on server

4) I understand XREP and ROUTER sockets are currently the same but may
diverge in the future. Which socket type should I use right now for this
application in order to guarantee consistent behaviour going forward?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120209/82a32e77/attachment.htm>

More information about the zeromq-dev mailing list