Bootstrap FreeKB - RabbitMQ - List Queues using the REST API
RabbitMQ - List Queues using the REST API

Updated:   |  RabbitMQ articles

This assumes you have created a RabbitMQ user with the administrator tag.

Refer to the RabbitMQ REST API documentation.

The curl command with the --user option can be used to make an API connection to RabbitMQ. In this example, John Doe will make a connection to the RabbitMQ server listening on port 15671 and list every queue.

curl
--request GET
--user john.doe:itsasecret
--url http://hostname:15671/api/queues

 

Or, you can list all of the queues in a specific virtual host.

curl
--request GET
--user john.doe:itsasecret
--url http://hostname:15671/api/queues/vhost001

 

Or, you can specify a specific queue in a specific virtual host.

curl
--request GET
--user john.doe:itsasecret
--url http://hostname:15671/api/queues/vhost001/queue001

 

For the / vhost, use %2F.

curl
--request GET
--user john.doe:itsasecret
--url http://hostname:15671/api/queues/%2F/queue001

 

If the queue does not exist, something like this should be returned.

{
  "error":"Object Not Found",
  "reason":"Not Found"
}

 

On the other hand, something like this should be returned for each queue.

{"messages_details":{"rate":0.0} 
"messages":0 
"messages_unacknowledged_details":{"rate":0.0} 
"messages_unacknowledged":0 
"messages_ready_details":{"rate":0.0} 
"messages_ready":0 
"reductions_details":{"rate":0.0} 
"reductions":2789586 
"node":"rabbit@server001" 
"arguments":{} 
"exclusive":false 
"auto_delete":false 
"durable":true 
"vhost":"/" 
"name":"queue001" 
"message_bytes_paged_out":0 
"messages_paged_out":0 
"backing_queue_status":{"mode":"default" 
"q1":0 
"q2":0 
"delta":["delta" 
"undefined" 
0 
0 
"undefined"] 
"q3":0 
"q4":0 
"len":0 
"target_ram_count":0 
"next_seq_id":0 
"avg_ingress_rate":0.0 
"avg_egress_rate":0.0 
"avg_ack_ingress_rate":0.0 
"avg_ack_egress_rate":0.0 
"mirror_seen":0 
"mirror_senders":0} 
"head_message_timestamp":null 
"message_bytes_persistent":0 
"message_bytes_ram":0 
"message_bytes_unacknowledged":0 
"message_bytes_ready":0 
"message_bytes":0 
"messages_persistent":0 
"messages_unacknowledged_ram":0 
"messages_ready_ram":0 
"messages_ram":0 
"garbage_collection":{"minor_gcs":1817 
"fullsweep_after":65535 
"min_heap_size":233 
"min_bin_vheap_size":46422} 
"state":"running" 
"recoverable_slaves":["rabbit@server001"] 
"synchronised_slave_nodes":["rabbit@server001"] 
"slave_nodes":["rabbit@server001"] 
"memory":68224 
"consumer_utilisation":null 
"consumers":0 
"exclusive_consumer_tag":null 
"policy":"ha_mirror_two"}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter f7f4d4 in the box below so that we can be sure you are a human.