[zeromq-dev] v3.1 publisher filtering

Joshua Foster jhawk28 at gmail.com
Tue Mar 13 00:43:45 CET 2012


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 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/20120312/329a5936/attachment.htm>


More information about the zeromq-dev mailing list