[rabbitmq-discuss] Polling Average message size in a queue

Matthias Radestock matthias at rabbitmq.com
Wed Mar 5 19:33:16 GMT 2014


On 05/03/14 19:22, Arun Rao wrote:
> I am interested in monitoring the average size of messages flowing
> through a queue. I could use the API to get messages with requeue set to
> true, so that I have the output of a message to determine size.
> Unfortunately, this method is not effective when consumers are consuming
> faster than producers.
>
> The other option is to write a java program with higher consumer
> priority which connects intermittently to the queue and requeues the
> messages after I determine the size.
>
> Any other ideas/suggestions that I missed?

Set up a second queue with exactly the same bindings as the first, and 
let your average-size-calculating program consume & ack messages in that.

Matthias.



More information about the rabbitmq-discuss mailing list