[zeromq-dev] strange behavior with pub/sub sockets (when pub connects)

Martin Sustrik sustrik at 250bpm.com
Fri Apr 8 08:32:04 CEST 2011


On 04/07/2011 07:13 PM, Ian Barber wrote:
> On Thu, Apr 7, 2011 at 5:58 PM, Robert W <robertwalters83 at gmail.com
> <mailto:robertwalters83 at gmail.com>> wrote:
>
>     In this example, there is one publisher and one subscriber.
>     The publisher connects and the subscriber is the one that binds.
>
>     It looks like the publisher acts like a durable publisher and does
>     not drop messages (even if there is no subscriber).
>     This is quite different from what the documentation says.
>
>
> I suspect this is an effect of the slightly different way of treating
> connect/bind with regards to buffers - the publisher is trying to
> connect, retrying etc., hence has not dropped, while a bound one knows
> it has no connections, and can drop. If that's the reason, I can see the
> confusion, interesting side effect!

Ian is right. What you should do is set HWM on the connecter. Thus, even 
if not connected, excessive messages will be dropped when HWM is reached.

Martin



More information about the zeromq-dev mailing list