Is there any way for the amqplib, of node to monitor the number of messages in the current queue?

recently tried to use rabbitmq, under node to manage using the npm package amqplib.

now there is a question, that is, after I have created a queue for rabbitmq, I want to know how much content in the current queue has not been processed through amqplib API or other ways, so as to prevent more and more content. The original intention is to sample and process the newly added content when the content in the queue exceeds a certain amount.

but amqplib has not been found to have related abilities, so I would like to ask experienced people here:

  • what is the way to view information such as the degree of accumulation of a queue in rabbitmq in a node environment? (if you don"t use amqplib, it seems possible to use the http interface that comes with rabbitmq, but it"s inconvenient, and I don"t know if it"s a good way)
  • is there any good way to deal with using rabbitmq, if I always produce faster than I consume? (I think of sampling)

Thank you! ~

Menu