Retrieving number of unacknowledged messages in RabbitMQ queue from Java/ Spring

前端 未结 2 1835
-上瘾入骨i
-上瘾入骨i 2021-02-08 17:03

is there any way to return the number of messages that are unacknowledged?

I am using this code to get the number of messages in the queue:

DeclareOk dec         


        
相关标签:
2条回答
  • 2021-02-08 17:09

    As you say in your update, if you enable the management plugin, you can query the rest api:

    Eg:

    `http://username:password@queue-server:15672/api/queues/%2f/queue_name.queue`
    

    This returns json with (among other things)

    • messages_unacknowledged
    • messages_ready

    It's good stuff if you have a safe route to the server.

    0 讨论(0)
  • 2021-02-08 17:16

    actual url for 3.8.9 version:

    http://username:password@queue-server:15672/api/queues/%2F/queue-name

    0 讨论(0)
提交回复
热议问题