Check RabbitMQ queue size from client

后端 未结 9 1125
终归单人心
终归单人心 2021-01-30 20:12

Does anyone know if there\'s a way to check the number of messages in a RabbitMQ queue from a client application?

I\'m using the .NET client library.

9条回答
  •  悲哀的现实
    2021-01-30 21:07

    You can use the IModel's MessageCount method, documented here

    http://www.rabbitmq.com/releases/rabbitmq-dotnet-client/v3.6.4/rabbitmq-dotnet-client-3.6.4-client-htmldoc/html/type-RabbitMQ.Client.IModel.html#method-M:RabbitMQ.Client.IModel.MessageCount(System.String)

    edit: I know this is a very old post, but it is the first google response, and I hope it will help people looking for this answer in the future.

提交回复
热议问题