[rabbitmq-discuss] Querying broker info like rabbitmqctl does?

Simon MacMullen simon at rabbitmq.com
Wed Oct 10 10:34:37 BST 2012


On 09/10/12 18:54, Matt Pietrek wrote:
> Now, I realize that this is an inherently racy circumstance.

As long as you realise that :-)

> I'm just
> trying to reduce the window as much as possible. As I see it, I have
> three options:
>
>   * Crank up the default update interval, suppressing perf as I go to
>     smaller intervals

Sounds less than wonderful as you note.

>   * Somehow query the broker in the same way that rabbitmqctl does. I
>     assume this involves writing Erlang code, which I'd like to avoid
>     for time reasons.

Well it involves interaction with Erlang. You can join an Erlang 
distributed system from Java for example, and there exists code which 
uses this to get rabbitmqctl-like statistics.

I can't say I'd recommend it though - complex and fragile.

>   * Call rabbitmqctl and capture/parse the output.

This is probably easiest of the three. The output is designed to be easy 
to parse, FWIW.

If you were interested in the messages_ready stat I'd suggest you 
passive declare the queue over AMQP - the declare-ok you get back will 
give you that number. But there's no space in the protocol for 
messages_unacknowledged :-(

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list