簡體   English   中英

如何使用 curl 命令在 activemq 主題中發布消息?

[英]how to post a message in activemq topic using curl command?

如何使用curl在 ActiveMQ 主題中發布消息? 我試過:

curl -XPOST -d "body=message" http://admin:admin@localhost:8161/api/message?destination=queue://orders.input

但響應是未經授權的用戶 401。

根據ActiveMQ 文檔,以下兩項都對我有用

curl -XPOST -u admin:admin -d "body=message" http://localhost:8161/api/message/orders.input?type=queue

curl -XPOST -d "body=message with alt syntax" http://admin:admin@localhost:8161/api/message?destination=queue://orders.input

您是否能夠使用憑據admin/admin登錄 Web 界面並查看隊列? 嘗試查看http://localhost:8161/admin/queues.jsp進行確認。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM