[zeromq-dev] Disconnecting from permanently dead endpoints

Pieter Hintjens ph at imatix.com
Wed Jan 25 17:29:38 CET 2012


On Wed, Jan 25, 2012 at 9:25 AM, Pierre Ynard <linkfanel at yahoo.fr> wrote:

> I want to set up a messaging system where a zeromq socket connects to
> several endpoints (with TCP). Some of these endpoints may go permanently
> down, and the corresponding transport addresses could even be reused
> by a totally unrelated service. So I need to a way to "disconnect" the
> zeromq socket from this endpoint, as keeping around zombie endpoints to
> periodically try to reconnect to them is unnecessary, undesirable and
> does not scale. The only way I see to do this is to close the socket,
> create a new one, and reconnect it to all the remaining endpoints, but
> that's quite suboptimal. Did I overlook something?

Mainly, it depends on the type of messaging pattern.

For pub-sub, subscribers can come and go, 0MQ handles this automatically.

For request-reply, you need to use a load-balancing pattern such as
least-recently used.

For other pattterns it gets harder and some people resort to creating
one socket per connection.

-Pieter



More information about the zeromq-dev mailing list