【发布时间】:2017-03-02 17:23:44
【问题描述】:
如何使用curl 在 ActiveMQ 主题中发布消息?我试过了:
curl -XPOST -d "body=message" http://admin:admin@localhost:8161/api/message?destination=queue://orders.input
但响应是未经授权的用户 401。
【问题讨论】:
如何使用curl 在 ActiveMQ 主题中发布消息?我试过了:
curl -XPOST -d "body=message" http://admin:admin@localhost:8161/api/message?destination=queue://orders.input
但响应是未经授权的用户 401。
【问题讨论】:
根据the ActiveMQ documentation,以下两项都对我有用:
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进行确认。
【讨论】: