[zeromq-dev] Question about the PUBSUB design pattern when server restarts.

Pieter Hintjens ph at imatix.com
Mon Nov 15 09:11:47 CET 2010


Hi Janak,

>   Do I have to call connect from client side after every s_recv call ?

No, you call once and 0MQ will reconnect to the publisher
automatically.  You can try this with the wu example.

>   Currently, I see that if I dont call connect on SUB and PUB stops and 2
> minutes later starts again, memory usage on pub keeps on increasing ? May
> be, its because it might be keeping it in queue for the sub to get the data.

I'm not sure about your description here.  If pub stops, how can its
memory usage keep on increasing?

If pub stops, sub will finish processing whatever data was in-flight,
and then stop.  When pub starts again, it will send to all subs that
(re-)connect to it.  They'll reconnect automatically as soon as they
find the pub socket is available again.

-Pieter



More information about the zeromq-dev mailing list