[zeromq-dev] How many messages are in queue now?

Ilja Golshtein ilejncs at narod.ru
Fri Apr 17 15:28:54 CEST 2015


Hello Pieter,

thank you for your answer.

I am in process of reading http://zguide.zeromq.org/hx:chapter7 , while atomic counter seems more natural choice for inproc so far.

Could you please explain why it is possible to detect that we are at 100% of HWM and it is not possible to detect that we are e.g. at 90% ?

17.04.2015, 11:54, "Pieter Hintjens" <ph at imatix.com>:
> It was never possible, due to the fact that pipes are being written
> and read asynchronously. You cannot measure the free space except by
> stopping everything.
>
> The workaround is to use credit based flow control. I've a section in
> the Guide that explains how this works. You can in effect know what %
> of the pipe from sender to receiver (including all ZeroMQ and network
> buffers) is filled.
>
> -Pieter
>
> On Wed, Apr 15, 2015 at 4:30 PM, Ilja Golshtein <ilejncs at narod.ru> wrote:
>>  Hello.
>>
>>  I used to think that it is possible to retrieve number or queued messages per socket in recent versions of 0mq, while I failed to find correspond getsockopt in 4.0.5
>>
>>  Use case: I need to alter behavior of my application (drop certain type of messages) if a queue is, say, 90% of HWM.
>>
>>  Please, advise if this facility is implemented or planned, or suggest a workaround which is more elegant than having atomic variable (it is inproc) maintained by reader and writer threads which is what I plan to do.
>>
>>  Thanks.
>>
>>  --
>>  Best regards
>>  Ilja Golshtein
>>  _______________________________________________
>>  zeromq-dev mailing list
>>  zeromq-dev at lists.zeromq.org
>>  http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-- 
Best regards
Ilja Golshtein



More information about the zeromq-dev mailing list