[zeromq-dev] Pub - Sub pattern and IP v6

Martin Sustrik sustrik at 250bpm.com
Wed Jun 29 15:06:45 CEST 2011


Hi Emmanuel,

> First a question about IP v6. Is it supported by ZMQ?

Nope. It used to be, but the solution back then caused problems with 
IPv4 connectivity on boxes with dual stack. Thus, it was disabled. You 
are free to give it another try though.

> Then a question related to Pub-Sub system design. I have entities
> publishing several kind of data. I have subscribers interested in only
> one kind
> of published data. There are two kinds of design:
>
> 1 - Every data kind will be published by the entity using its own publisher
> 2 - Only one publisher is used by the entity but with a message envelop
> used by the subscriber in the ZMQ_SUBSCRIBE socket option.
>
> Design number 1 could lead to a large number of publishers because on a
> dedicated host, I will have thousand of entities publishing data and the
> number of publisher will be the number of entities multiplies by  the
> number of data kind.
> Design number 2 will generate useless network traffic and CPU activities
> for subscribers to receive and filter out the data they are not
> interested in (filtering in one the subscriber side).
>
> Which design is the best one? Is there other way to build this kind of
> system?

Design 1 makes sense only when there are two feeds that are conceptually 
different. Say a weather forecast feed and a videoconferencing feed.

If there's a single feed and individual consumers want to filter out 
some subset of messages (say weather forcast for London), then option 2 
is preferable.

Unfortunately, in vestion 2.x, filtering is done on the subscriber, 
which causes even unneeded data to pass the network.

This inefficiency was addressed in version 3.0 (trunk) where filtering 
is done on the publisher side. See design whitepaper here: 
http://www.250bpm.com/pubsub

Martin


More information about the zeromq-dev mailing list