[rabbitmq-discuss] Is it possible to get a "push" when number of messages reaches threshold?

Alvaro Videla videlalvaro at gmail.com
Sun Jun 1 16:18:19 BST 2014


Hi,

I'd guess this could be attempted using queue length:
http://www.rabbitmq.com/maxlength.html and setting up a separate dead
letter queue for that 5000th message.

Regards,

Alvaro


On Sun, Jun 1, 2014 at 3:37 PM, Michael Klishin <mklishin at gopivotal.com>
wrote:

> On 1 June 2014 at 17:34:11, rails (stammailbox at gmail.com) wrote:
> > > 1. What is the best practice to get the number of messages in a
> > queue.
> > I know I can get it via queue.getMessageCount()
>
> Do a queue.declare (possibly with passive = true), check # of messages
> ready from
> queue.declare-ok. You can also query queue stats using HTTP API.
>
> > What is the best way if I want to react only when X messages arrive?
>
> Add a consumer and process deliveries in batches  in your own code.
>
> > 2. And more important - can I get the number of messages in a queue
> > via push?
>
> There is no such feature in RabbitMQ. You have to periodically check the
> counter.
> --
> MK
>
> Software Engineer, Pivotal/RabbitMQ
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140601/600741f8/attachment.html>


More information about the rabbitmq-discuss mailing list