在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"
}
但是使用Spring-AMQP或RabbitMQ-client for Java,似乎不可能。
例如,像这样:
rabbitAdmin.getQueueInformation ("queueName")
或
channel.queueInformation ("queueName")
答案 0 :(得分:1)
Spring-AMQP和Rabbit客户端用于运行时AMQP协议;您可以使用Spring的RestTemplate
访问ReST API;它内置了jackson支持来转换JSON。
在更高级别,您可以使用Spring Integration' http:outbound-gateway。