[zeromq-dev] Discussion on ROUTER action

Yu Dongmin miniway at gmail.com
Thu Dec 6 04:36:05 CET 2012


As we all know, ROUTER drop messages when 1) a counter part doesn't exist and 2 ) a counter part is full.

In case of 1) we can catch the case by setting ZMQ_ROUTER_MANDATORY. But in case of 2) ROUTER drop message silently and the send returns 0.

Server side ROUTER-DEALER pattern including the proxy (a.k.a device) is hard to use as I need another treatment at client side.

To make a client simple and avoid the second case of silent dropping, I have to increase the HWM or unlimited but it could blow memory.

We might need an another option to detect second case. By detecting the case, ROUTER user can decide whether he drop it silently (default action), resend it or wait the counter part is ready.

My idea is (please ignore option names, they are just examples) in the case of 2)

if ZMQ_ROUTER_WAIT set router.xsend returns -1 with EAGAIN so system can wait the counter part is ready
Otherwise returns -1 as user can do his treatment.


More information about the zeromq-dev mailing list