I am using node-amqp as a queue system in a node application. I would like to be able to monitor the status of the queue to find out if we have a sufficient number of desktops, i.e. If the size of the queue increases, we know that we are starting to lag.
I know that from the command line you can use something like:
rabbitmqctl list_queues
Which gives me the exact information I need, but I was wondering if it is even possible to do this from node -amqp?
Thanks in advance.
EDIT
In the end, I just used the rabbitmqctl command-line tool to get the information I needed, this is not a great solution, but here's what I did;
var Logger = require('arsenic-logger');
getQueueMeta(function(info){
Logger.info(info);
});
function getQueueMeta(callback){
var sys = require('sys')
var exec = require('child_process').exec;
exec("/usr/local/sbin/rabbitmqctl list_queues", function(error, stdout, stderr) {
var info = [];
if (!error){
var lines = stdout.split(/\n/);
if (lines.length > 1){
for (var i=1; i<lines.length-2; i++){
var temp = lines[i].split(/\s/);
info[temp[0].trim()] = parseInt(temp[1]);
}
}
}
callback(info);
});
}