[zeromq-dev] Label and Identity in XREP-XREQ sockets

Pieter Hintjens ph at imatix.com
Thu Dec 15 03:51:56 CET 2011


Hi Abhinav,

You should probably not use 3.0 since it's going to be killed (and its
experimental features dropped for now).

Your question is, I think, answered by the Guide material on using
ROUTER sockets.

-Pieter

On Mon, Dec 12, 2011 at 12:47 PM, Abhinav Goyal <abhinav at sydney.edu.au> wrote:
> Hi,
>
> I am working on a distributed system where multiple clients and servers can
> be present in the network. I have implemented a registry/discovery using
> which the servers register themselves and the clients are able to find (and
> connect to) the servers. The clients are implemented as XREQ sockets and
> servers are implemeted as XREP sockets. So far, everything works well- have
> I said "Thanks for ZMQ, guys" yet? :)
>
> Now, I have a new requirement for *also* being able to direct a request to a
> specified server. I implemented an approach wherein the server sets its
> socket identity to its name (a user specified string) and the client uses
> ZMQ_SNDLABEL to specify the server to which the request must be sent.
> However, this approach doesn't seem to be working (messages are going to
> other servers).
>
> I am wondering if this approach should ordinarily work and isn't working
> because I am doing something incorrectly (not setting the proper flag(s),
> not sending the null message in the proper place, etc).
>
> Could it be that SNDLABEL only use ZMQ's internal labels? If that is the
> case, is there a way for me to retrieve the internal label at the server end
> so that I can publish this to the registry service and the clients can route
> the messages appropriately?
>
> I almost forgot to mention that I am using ZMQ 3.0.
>
> Thanks,
> Abhinav
>
>
> PS: Apologies if this question has been asked previously and this is just a
> repeat. I tried to look for a search box on the web interface for the
> archives but couldn't find one.
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list