[zeromq-dev] XPUB subscription notifications

Pieter Hintjens ph at imatix.com
Thu Oct 4 20:25:48 CEST 2012

On Wed, Oct 3, 2012 at 7:42 PM, Dan Goes <DGoes at blueorigin.com> wrote:

> I’ve been using an XPUB ZMQ socket on a server with a collection of client
> SUBscribers, with zeromq-3.2.0. I’ve noticed that when a subscriber
> subscribes to a specific topic, if another subscriber has previously
> subscribed to that topic, no notification is generated on the server’s XPUB
> socket. Digging around a little bit, I found that this is working as
> intended, and is built into the XPUB port (cf. comments on lines 75 and 76
> of xpub.cpp in zeromq-3.2.0).

Indeed... I'd forgotten this behaviour. XPUB won't tell you actual
state on subscribers.

I can see two options. One is to extend XPUB so it does this, enabling
that with a setsockopt. Second is to switch to ROUTER sockets with an
explicit protocol for subscription and last used values.


More information about the zeromq-dev mailing list