[zeromq-dev] publish/subscribe and the "fast producer" problem

Francesco francesco.montorsi at gmail.com
Thu Mar 9 14:56:06 CET 2017


Hi Max,

2017-03-07 20:51 GMT+01:00 Max Kozlovsky <max at portworx.com>:
> I wonder what is the practical application of this model? If for correctness
> of the application it is enough to deliver every message to at least one of
> the subscribers, why not always sent just one copy of a message to just one
> of the subscribers?
No the correctness model is the following: assume that you have 10
subscribers. Suddenly 1 of them looses connectivity / crashes /
whatever. The other 9 are ok.
What happens is that:
a) If I use the NODROP=1, my publisher blocks and stops processing its
own data, eventually leading to a drop of its own inputs. The whole
system is now blocked (publisher dropping its input events [not coming
from network], 9 subscribers all waiting for the publisher to
publish).
b) If I use a currently non-existing ZMQ_XPUB_ATLEASTONE=1 option, my
publisher keeps publishing, 9 subscribers keep working, just 1 is
stopped / out of service. Outcome in my case: 90% of my application is
still working, I have 10% of data that is not processed and lost.

Which scenario is best? IMO it's b) :)


>Sends to the rest of the subscribers are overhead since
> they are not required for correctness?
They are required, but in case something goes bad I prefer the failure
of a part rather than the failure of everything.

Francesco



More information about the zeromq-dev mailing list