Foo-Foo-MQ / foo-foo-mq

Abstractions around RabbitMQ
MIT License
48 stars 24 forks source link

Queue message Count #41

Open chris-cynation opened 1 year ago

chris-cynation commented 1 year ago

Is there a way to get the current queue message count?

Looking to periodically check to reduce back pressure.

zlintz commented 1 year ago

At this moment no there is not a way to get queue count, I am not sure that is possible with amqplib currently. The underlying tech is ampqlip https://amqp-node.github.io/amqplib/channel_api.html so if you are interested in adding that functionality to this package please open a PR

chris-cynation commented 1 year ago

I think https://amqp-node.github.io/amqplib/channel_api.html#channel_checkQueue

Gives the info, but unsure of the implications perf wise.

For those interested I currently make an http management call to get the info.

zlintz commented 1 year ago

@chris-cynation interesting. Would you be willing to give an example of that request here for others can do something in the interim?

chris-cynation commented 1 year ago

Here's how I do it: http: method: 'get', url: http://${rabbitHost}:15672/api/queues/%2F/${queueName}

response.messages

has the message count.

zlintz commented 10 months ago

Do you still desire this? Others?

@chris-cynation are you willing to open a PR for this?

chris-cynation commented 10 months ago

Hi, I'd desire it but wouldn't have the time to work on it.

zlintz commented 1 week ago

I'm not closing this as I think it is useful, as clearly you opened this as it would be useful in your scenario. @chris-cynation if you feel things are not problematic how you are currently handling things though maybe keep doing as your doing. Its been awhile and no one else has responded.

I also have limited time, as much as I would like to dedicate here. This is more of a passion project for me