[zeromq-dev] PUB doesn't discard msg when no SUB

Pieter Hintjens ph at imatix.com
Fri May 27 14:48:00 CEST 2011

On Thu, May 26, 2011 at 11:18 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:

> How it would
> look like from user's point of view is that random messages would be
> missing from the middle of the feed.

My point is it'll _always_ look like that when you drop the 'oldest',
but this is OK, and better than dropping the newest, in time-sensitive

Scenario: you're getting stock ticks, and there's a queue build up
somewhere. Someone decides to drop messages. It's upstream from you,
so the only symptom you have is gaps in the messages. Now, what is
better, dropping older, or dropping newer? It's irrelevant that the
gap may be upstream from you. Obviously the sender cannot reach into
your memory and say "stop processing that message!"

Receiver will often get some old messages before the gap. Fine, not a
reason to make the cost of lost messages worse than it has to be.

So if you drop oldest on 0MQ's send buffers, you'll get gaps that
better match the most common requirements.


More information about the zeromq-dev mailing list