【问题标题】:how to post a message in activemq topic using curl command?如何使用 curl 命令在 activemq 主题中发布消息?
【发布时间】: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。

【问题讨论】:

    标签: java curl activemq


    【解决方案1】:

    根据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进行确认。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-24
      • 2019-04-17
      • 2018-03-18
      • 2015-11-15
      • 1970-01-01
      • 2020-09-06
      相关资源
      最近更新 更多