[zeromq-dev] exiting without missing messages

Mathijs Kwik bluescreen303 at gmail.com
Sat Aug 20 10:44:32 CEST 2011

Hi all,

I would like to be able to scale a part of my application by just
adding processes/boxes.
If load is lower again, I would like to remove them again.

This part of the application uses a PULL socket to get work.
And just like in the guide/example some kind of ventilator is

Now, adding processes is easy, just zmq_connect them and the load
balancing push socket will do its magic trick automatically.

However, I couldn't find a way to disconnect again.
Looking at the manpage for zmq_close, it tells me that it is going to
drop messages that have been received from the network, but not yet
handed out to the app itself.

So zmq_close isn't gonna work for me.
Even if there was a way to make sure nothing is in the "incoming"
buffer, I understand that the push socket might already have queued
messages for a specific pull socket, so if that disappears, messages
get stuck waiting on the push side.
So it would be nice if there's a way to tell the push socket to stop
sending / disconnect a certain puller.

Is there a graceful way to just take out a few workers without
dropping messages?
Or do I need to build all kinds of checks around it where the
ventilator and the sink communicate a lot to detect missing messages
and use in-app buffers in the ventilator so it can resend missing
I hope this isn't needed, since it will cause latency. This isn't an
error/exception situation either, just a "planned" change in the

More information about the zeromq-dev mailing list