Curl to get Rabbitmq queue size

前端 未结 5 1954
花落未央
花落未央 2021-02-05 09:47

Is there a way to get the size (remaining messages) of a queue in rabbitmq with a simple Curl?

Something like curl -xget http://host:1234/api/queue/test/stats

5条回答
  •  滥情空心
    2021-02-05 10:20

    Finally I did the trick with the following:

    curl -s -i -u guest:guest http://host:port/api/queues/vhost/queue_name | sed 's/,/\n/g' | grep '"messages"' | sed 's/"messages"://g'
    

提交回复
热议问题