[zeromq-dev] Check if message is dropped due to HWM at send in ZeroMQ PUB-SUB pattern

Pieter Hintjens ph at imatix.com
Tue Sep 30 08:41:56 CEST 2014

> I want to let my publisher know if he is dropping messages because he has hit the HWM.

Then do not use pub-sub but router-dealer. Pub-sub is designed for
high volumes with many subscribers. There is no useful way to deal, in
the publisher, with a single slow or blocked subscriber, and ZeroMQ
pub-sub does not support that.

On Tue, Sep 30, 2014 at 1:36 AM, Ranganath Gunawardane
<ranganath at outlook.com> wrote:
> Hi All, I have implemented a message router using zmq, czmq with pub-sub
> pattern.
> In my simple test set up, I am using a publisher-subscriber with a proxy. I
> have a fast sender and a very slow receiver causing messages to hit HWM and
> drop on send. My exception is that send would fail with 'message dropped'
> error, but it is not the case. the zmq_msg_send() is not giving me any error
> even though the messages get dropped (I can verify this by seeing gaps in
> messages in subscriber end).
> I have looked into fixing slow subscriber problem by adding a sequence
> number as you suggested, specially suicidal snail pattern in the guide. But
> my use case is a bit different. I really do not care about the subscribers;
> I want to let my publisher know if he is dropping messages because he has
> hit the HWM.
> I gather that this is the nature of pub-sub. At the same time, from
> documentation, it says, if I use ZMQ_DONTWAIT, and 'if the message cannot be
> queued on the socket, function call shall fail'. Does it mean that I can use
> this failure as a 'send failure due to buffer full'?
> Regards.
> Ranganath
> _______________________________________________
> 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