[zeromq-dev] v3.1 publisher filtering

Steve steve.friendly at gmail.com
Wed Mar 14 19:51:47 CET 2012


Shripad,

It sounded like Pub/Sub was essentially the same on 2.1 vs 3.1 other than
the XPUB / XSUB.  So, I just took the example from the 0MQ guide which is
v2.1 I believe.  I will try your test on 3.1 and verify.

Thanks for looking into this!

Steve


On Wed, Mar 14, 2012 at 3:07 AM, Shripad K <assortmentofsorts at gmail.com>wrote:

> Steve I just checked via Wireshark. It is doing PUB side filtering. Are
> you sure that you are testing this with zmq 3.1? I setup a simple PUB/SUB
> in zeromq.node <https://github.com/shripadk/zeromq.node> fork. Here is my
> test code:
>
> // subscriber:
> var zmq = require('zmq-3.0');
> var sub = zmq.createSocket('sub');
> sub.connect('tcp://0.0.0.0:3333');
>
> sub.on('message', function(buf) {
>  console.log(buf.toString());
> });
> sub.subscribe('a');
>
> // publisher:
> Array.prototype.rotate = function() {
>  var elem = this.shift();
> this.push(elem);
> return elem;
> };
> var zmq = require('zmq-3.0');
> var pub = zmq.createSocket('pub');
> pub.bindSync('tcp://0.0.0.0:3333');
>
> var arr = ['a', 'b', 'c'];
> var count = 0;
>
> setInterval(function() {
> pub.send( arr.rotate() + ':' + (count++) );
> }, 2500);
>
> With 2.1 Wireshark shows that it is performing a subscriber side
> filtering. Not with 3.1 though.
>
> On Wed, Mar 14, 2012 at 1:05 PM, Ian Barber <ian.barber at gmail.com> wrote:
>
>>
>>
>> On Wed, Mar 14, 2012 at 1:31 AM, Joshua Foster <jhawk28 at gmail.com> wrote:
>>
>>>  PUB functions the same in 3.1 as 2.1, but XPUB actually does publisher
>>> side filtering. (if I read the code correctly)
>>>
>>> Joshua
>>>
>>
>> Don't think you did Joshua - they both use the same distribution code
>> (dist/send to matching). Pub is really just a very thin wrapper around
>> Xpub, and removes the recving of subs to the app code.
>>
>> Ian
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://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/20120314/eebc1098/attachment.htm>


More information about the zeromq-dev mailing list