在 RabbitMQ 的 REST API 中,您可以获得现有队列的各种信息(http://rabbit.example.com:15672/api/queues/):
{
"memory": 10888,
"messages": 0,
"messages_details": {
"rate": 0
},
"messages_ready": 0,
"messages_ready_details": {
"rate": 0
},
"messages_unacknowledged": 0,
"messages_unacknowledged_details": {
"rate": 0
},
"idle_since": "2014-12-12 13:59:46",
"policy": "",
"exclusive_consumer_tag": "",
"consumers": 0,
"backing_queue_status": {
"q1": 0,
"q2": 0,
"delta": [
"delta",
"undefined",
0,
"undefined"
],
"q3": 0,
"q4": 0,
"len": 0,
"pending_acks": 0,
"target_ram_count": "infinity",
"ram_msg_count": 0,
"ram_ack_count": 0,
"next_seq_id": 0,
"persistent_count": 0,
"avg_ingress_rate": 0,
"avg_egress_rate": 0,
"avg_ack_ingress_rate": 0,
"avg_ack_egress_rate": 0
},
"status": "running",
"name": "${sistemaConsumidor}.${domain}.${evento}.RetryQueue",
"vhost": "/",
"durable": true,
"auto_delete": true,
"arguments": {
"x-dead-letter-exchange": "${exchangeType}.${domain}",
"x-message-ttl": 5000,
"x-dead-letter-routing-key": "${sistemaProdutor}.to.${sistemaConsumidor}.${domain}.${evento}"
},
"node": "rabbit@CI-41644-7"
}
但是对于 Java 的 Spring-AMQP 或 RabbitMQ-client,这似乎是不可能的。
例如,像这样:
rabbitAdmin.getQueueInformation ("queueName")
或者
channel.queueInformation ("queueName")