node.js - AMQP - How many consumers on a queue? -
using amqp module node js , rabbitmq, there way tell how many subscribers there on queue?
we have multiple queues on default exchange multiple regions. when 1 region down, instead of routing messages queue, we'll instead route next-best amqp queue (region) actively listening.
is there way count number of subscribers on queue?
we have heartbeat set server should able track accurately.
thanks!
i ended figuring out piece of gold:
var conn = amqp.createconnection({ url: process.env.amqp, heartbeat: 60 }); conn.queue('queue-name').on('queuedeclareok', function(args) { console.log('total consumers: ' + args.consumercount); } works :)
Comments
Post a Comment