我有多个RabbitMQ服务器。
我需要一个接口(使用JSP),我可以管理(删除所有这些服务器的队列/交换/消息)。
在内部我会调用curl命令来执行操作。
示例:创建队列
curl -i -u test:test -H "content-type:application/json" \
-XPUT -d'{"type":"direct","durable":true}' \
http://192.168.0.30:15672/api/queues/%2f/myQueue
如何使用curl删除/移动队列中的邮件?
答案 0 :(得分:1)
答案 1 :(得分:0)
用卷曲的铲子可以完成工作:
curl
-u "user:password"
-vvv 'http://localhost:15672/api/parameters/shovel/%2Foms/Move%20from%20sourceQueue'
-X PUT
-H 'content-type: application/json'
--data-binary '
{
"component": "shovel",
"vhost": "/vhost",
"name": "Move from sourceQueue",
"value": {
"src-uri": "amqp:///%2Fvhost",
"src-queue": "sourceQueue",
"src-protocol": "amqp091",
"src-prefetch-count": 1000,
"src-delete-after": "queue-length",
"dest-protocol": "amqp091",
"dest-uri": "amqp:///%2Fvhost",
"dest-add-forward-headers": false,
"ack-mode": "on-confirm",
"dest-queue": "destQueue"
}
}
' --compressed
答案 2 :(得分:-1)