[zeromq-dev] Duplicate messages on subscriber reconnect in pub/sub pair
Pieter Hintjens
ph at imatix.com
Fri May 13 08:19:16 CEST 2011
On Fri, May 13, 2011 at 12:36 AM, Benn Bollay <benn at f5.com> wrote:
> Using bog standard code (see http://pastebin.com/W3AvhQn5), and then forcing
> the tcp connection between the publisher and the subscriber to be reset, I
> am seeing duplicate messages on the subscriber’s side. I’ve observed this
> behavior both in 2.0 and in 2.1.7, and in C and python code.
This is normal and expected. The PUB socket holds a small queue of
outgoing messages so that new subscribers get some history (10
messages or so, iirc). The SUB socket gets its messages, and then you
break the connection and the SUB socket reconnects, thus appears to
the PUB as a new subscriber.
-Pieter
More information about the zeromq-dev
mailing list