[zeromq-dev] v3.1 publisher filtering

Calvin de Vries devries.calvin at gmail.com
Tue Mar 13 18:39:03 CET 2012

I'm not sure this is correct, Joshua. PUB filters the messages in 3.1,
while you can use XPUB in order to do more advanced subscription
management, it is not a requirement to have publisher side filtering.

In Steve's example, Subscriber A would not receive every message, only
messages matching its filter.

On Mon, Mar 12, 2012 at 7:43 PM, Joshua Foster <jhawk28 at gmail.com> wrote:

>  3.1 works the same way as 2.1 in your example. The changes in 3.1 is that
> the subscription is forwarded to the PUB socket. This allows you to create
> a publisher device. It would sit between the parent publisher and the
> subscriber. The XPUB keeps track of the subscriptions and allows them to
> apply to the XSUB socket. This effectively filters out any messages that do
> not match a subscription. In your example, you are matching against "a" and
> "" so all messages would be passed through.
> You can of course use a ROUTER socket and manage the subscriptions
> yourself in the application (with DEALER). The main downside is that you
> won't be able to detect client disconnections. You may also want to
> consider creating an alternative PUB socket implementation in ZeroMQ.
> Joshua
> On 3/12/2012 6:48 PM, Steve wrote:
> I have a high level question about how a v3.1 publisher handles sending
> updates to subscribers.  I understand that v3.1 can push the subscription
> filtering further towards the publisher but to what degree I'm unclear on.
> Here is a very simple usage example:
> 1) Publisher has a list of topics that are randomly updated 10 times a
> second.  There are a total of 26 topics and each is a single lowercase
> alpha character representing the English alphabet (a - z).
> 2) Subscriber 'A' subscribes to just a topic matching "a".
> 3) Subscriber 'B' subscribes to all topics ("").
> In version 2.1, I believe Subscriber 'A' would receive all the messages
> and that the zeromq client library would filter them so the client would
> only see updates on 'a'.  In version 3.1, is it possible to filter the
> messages at the publisher so that Subscriber 'A' only receives updates on
> topic 'a' (no filtering done on the client) and that Subscriber 'B'
> receives all updates on all topics (a-z)?
> Thanks,
> Steve
> _______________________________________________
> zeromq-dev mailing listzeromq-dev at lists.zeromq.orghttp://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> 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/20120313/b5e65cf3/attachment.htm>

More information about the zeromq-dev mailing list