Here are the commands I use to get the contents of the queue:
RabbitMQ version 3.1.5 for Linux using https://www.rabbitmq.com/management-cli.html
Here are my exchanges:
eric@dev ~ $ sudo python rabbitmqadmin list exchanges +-------+--------------------+---------+-------------+---------+----------+ | vhost | name | type | auto_delete | durable | internal | +-------+--------------------+---------+-------------+---------+----------+ | / | | direct | False | True | False | | / | kowalski | topic | False | True | False | +-------+--------------------+---------+-------------+---------+----------+
Here is my turn:
eric@dev ~ $ sudo python rabbitmqadmin list queues +-------+----------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+ | vhost | name | auto_delete | consumers | durable | exclusive_consumer_tag | idle_since | memory | messages | messages_ready | messages_unacknowledged | node | policy | status | +-------+----------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+ | / | myqueue | False | 0 | True | | 2014-09-10 13:32:18 | 13760 | 0 | 0 | 0 |rabbit@ip-11-1-52-125| | running | +-------+----------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+
Drag and drop some objects into myqueue:
curl -i -u guest:guest http://localhost:15672/api/exchanges/%2f/kowalski/publish -d '{"properties":{},"routing_key":"abcxyz","payload":"foobar","payload_encoding":"string"}' HTTP/1.1 200 OK Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Date: Wed, 10 Sep 2014 17:46:59 GMT content-type: application/json Content-Length: 15 Cache-Control: no-cache {"routed":true}
RabbitMQ see messages in the queue:
eric@dev ~ $ sudo python rabbitmqadmin get queue=myqueue requeue=true count=10 +-------------+----------+---------------+---------------------------------------+---------------+------------------+------------+-------------+ | routing_key | exchange | message_count | payload | payload_bytes | payload_encoding | properties | redelivered | +-------------+----------+---------------+---------------------------------------+---------------+------------------+------------+-------------+ | abcxyz | kowalski | 10 | foobar | 6 | string | | True | | abcxyz | kowalski | 9 | {'testdata':'test'} | 19 | string | | True | | abcxyz | kowalski | 8 | {'mykey':'myvalue'} | 19 | string | | True | | abcxyz | kowalski | 7 | {'mykey':'myvalue'} | 19 | string | | True | +-------------+----------+---------------+---------------------------------------+---------------+------------------+------------+-------------+
Eric Leschinski Sep 10 '14 at 17:37 2014-09-10 17:37
source share