[nanomsg] Re: Generalizing pubsub distribution

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Sun, 13 Dec 2015 14:12:24 +0100

On 2015-12-13 13:48, Carlos Pita wrote:

Anyway, why would someone reimplement the sp? Because there are other
ways of distributing besides "drop msg if pipe is full". True, the
provided one is simple and sensible for the main use case:
distribution to many unknown, unreliable, maybe slow subscribers. But
the question of blocking when pipe is full pops up every once in a
while in stackoverflow and zmq's mailing list. There is even a patch
for zmq that implements that, although not without problems [1], [2].

The real problem here is that applying backpressure to the publisher turns a system that works nicely on its own into a system that has to be supervised by a human on 24/7 basis. Once there's a slow/dead consumer which causes the backpressure *nobody* is going to get any messages any more. At that point you need an ops person to identify the problem and fix it. If you add an algorithm to do the ops person's work, you'll end up with pub/sub as it is implemented in nanomsg or zmq now.

Martin

Other related posts: