[zeromq-dev] Discussion on ROUTER action
Pieter Hintjens
ph at imatix.com
Fri Dec 7 13:24:26 CET 2012
Hi Min,
I think you could extend ZMQ_ROUTER_MANDATORY to this. Mandatory means
the message must be deliverable, or you get an error.
-Pieter
On Thu, Dec 6, 2012 at 4:36 AM, Yu Dongmin <miniway at gmail.com> wrote:
> Hello,
>
> 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.
>
> Thanks
> Min
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list