能否直接从命令线上查看 RabitMQ 信件内容?
sudo rabidmqctl list_queues
列出队列 。
是否有类似 sudo raidmqctl list_queue_ messsages & lt; queue_ name>
这样的命令?
能否直接从命令线上查看 RabitMQ 信件内容?
sudo rabidmqctl list_queues
列出队列 。
是否有类似 sudo raidmqctl list_queue_ messsages & lt; queue_ name>
这样的命令?
您应该启用管理插件 。
rabbitmq-plugins enable rabbitmq_management
见此:
http://www.rabbitmq.com/plugins.html>http://www.rabbitmq.com/plugins.html
以及这里的 管理细节。
http://www.rabbitmq.com/management.html>http://www.rabbittmq.com/management.html
Finally once set up you will need to follow the instructions below to install and use the rabbitmqadmin tool. Which can be used to fully interact with the system. http://www.rabbitmq.com/management-cli.html
例如:
rabbitmqadmin get queue=<QueueName> requeue=false
将给您队列中的第一个消息 。
以下是我用来获取队列内容的命令 :
RabbitMQ 3.1.5 关于使用https://www.rabbitmq.com/management-cli.html
以下是我的交换:
eric@dev ~ $ sudo python rabbitmqadmin list exchanges
+-------+--------------------+---------+-------------+---------+----------+
| vhost | name | type | auto_delete | durable | internal |
+-------+--------------------+---------+-------------+---------+----------+
| / | | direct | False | True | False |
| / | kowalski | topic | False | True | False |
+-------+--------------------+---------+-------------+---------+----------+
这是我的队列:
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 |
+-------+----------+-------------+-----------+---------+------------------------+---------------------+--------+----------+----------------+-------------------------+---------------------+--------+---------+
将一些物品埋入细列中:
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}
RabitMQ 在队列中看到信件 :
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 |
+-------------+----------+---------------+---------------------------------------+---------------+------------------+------------+-------------+
我写了
示例用法( 倾弃前50条队列中 < code> coming_ 1 头50条信息) :
rabbitmq-dump-queue -url="amqp://user:[email protected]:5672/" -queue=incoming_1 -max-messages=50 -output-dir=/tmp
如果您想要从队列中获取多个消息, 请说 10 条, 使用的命令是 :
rabbitmqadmin get queue=<QueueName> ackmode=ack_requeue_true count=10
http://localhost:15672:
您可以使用 RabbitMQ API 获得计数或信件 :
/api/queues/vhost/name/get
从队列中获取消息 。 (这不是 HTTP Get, 因为它会改变队列状态 。) 您应该张贴像 :
{"count":5,"requeue":true,"encoding":"auto","truncate":50000}
计数要获取信件的最大数量。 如果队列无法立即提供信件, 您可能会收到更少的信件 。
requeue determines whether the messages will be removed from the queue. If requeue is true they will be requeued - but their redelivered flag will be set. encoding must be either "auto" (in which case the payload will be returned as a string if it is valid UTF-8, and base64 encoded otherwise), or "base64" (in which case the payload will always be base64 encoded). If truncate is present it will truncate the message payload if it is larger than the size given (in bytes). truncate is optional; all other keys are mandatory.
请注意,HTTP API的出版/获得路径是用于注射测试信息、诊断等的,它们不执行可靠的传送,因此应作为Sysadmin s 工具,而不是一般的用于发送信息的API。
http://hg.rabbittmq.com/rabbbitmq-management/raw-files/rabbbitmq_v3_1_3/priv/www/api/index.html
稍晚一点, 但是是的 rabbentmq 有在跟踪器中的构建, 允许您在日志中看到连接信件 。 启用后, 您可以只使用 < code>tail -f/ var/ tmp/ rabbbitmq- ttracing/. log code > (在 mac) 来查看信件 。
详细解码于此 < a href=" "http://www.mikeobrien.net/blog/ttracting-rabbitmq-mesages" rel= "no follown noreferrer" >http://www.mikeobrien.net/blog/ttracing-rabbittmq-mesages
For any given queue, the maximum length (of either type) can be defined using a policy (this option is highly recommended) or by clients using the queue s optional arguments. In the case where both ...
I m looking to implement RabbitMQ into my PHP application, and am using the php-amqp extension. My only question is this, how do I easily query to return the contents of the queue in PHP? php-amqp ...
I d like to make sure that my message was delivered to a queue. To do so I m adding the mandatory param to the basic_publish. What else should I do to receive the basic.return message if my message ...
I d like to use AMQP to join two services one written in C# and other written in python. I m expecting quite large volume of messages per second. Is there any AMQP Broker that is production ready? ...
I m attempting to follow the celery tutorial, but I run into a problem when I run python manage.py celeryd: my RabbitMQ server (installed on a virtual machine on my dev box) won t let my user login. ...
Is it possible to make multiple consumers to share one single queue in RabbitMQ? I am currently using this php library to work with RabbitMQ, from what I observe, although I have 2 identical instances ...
as opposed to writing your own library. We re working on a project here that will be a self-dividing server pool, if one section grows too heavy, the manager would divide it and put it on another ...
I m using py-amqplib to access RabbitMQ in Python. The application receives requests to listen on certain MQ topics from time to time. The first time it receives such a request it creates an AMQP ...