[zeromq-dev] Socket identities with subscription messages

Stefan Radomski radomski at tk.informatik.tu-darmstadt.de
Wed Nov 28 11:42:30 CET 2012

Hi Pieter,

thank you for your response. Actually I do have a solution, but relies on undocumented behavior: I realized that subscription messages are sent out in alphabetical order, by setting up my XSUB sockets to subscribe to a UUID prefixed with a "late" alphabetical prefix I can get an idea as to when a given subscriber sent out all of its subscriptions to a XPUB socket (I coordinate subscriber/publisher awareness with router/dealer sockets).

This is obviously a hack but should work with TCP as long as I do not subscribe to additional prefixes. Is it planned to have optional identities for XSUB sockets in the future? It seems like a logical next step after the introduction of ZMQ_XPUB_VERBOSE.

Best regards

On Nov 28, 2012, at 11:24 AM, Pieter Hintjens <ph at imatix.com>

> On Wed, Nov 28, 2012 at 12:42 AM, Stefan Radomski
> <radomski at tk.informatik.tu-darmstadt.de> wrote:
>> I would like to know the identity of the sockets subscribing to a XPUB socket. I already use ZMQ_XPUB_VERBOSE with the XPUB socket to see all subscriptions, but now I only know the number of subscribers and not their identities.
> Not possible; there is no concept of identities in PUB/SUB sockets in
> version 3.x.
>> With the ROUTER / DEALER socket pairs, the actual message is always an envelope with the sending sockets identity as the first message, is there some way to achieve something similar for XPUB/XSUB socket pairs?
> You can use DEALER/ROUTER pairs and do the message distribution yourself.
> -Pieter
> _______________________________________________
> 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