cURL 和 ActiveMQ

发布于 2024-09-26 19:14:43 字数 119 浏览 0 评论 0 原文

我需要一个关于如何使用 cURL 通过 HTTP 在 C 或 C++ 中读取/写入 ActiveMQ 队列的示例(或其他内容,目前我对任何内容都持开放态度)。 我有 C# 的工作代码,但没有帮助。 任何帮助表示赞赏, 谢谢。

I need an example on how to read/write to an ActiveMQ queue over HTTP in C or C++ using cURL (or something else, I'm open to anything at this point).
I have working code in C#, but it doesn't help.
Any help is appreciated,
Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

桃气十足 2024-10-03 19:14:43

首先我假设:

  • 您正在运行 activemq 5.5.0
  • 您正在使用默认的 activemq 配置,该配置启用 网络控制台
  • 通过 cURL 你的意思是 libcurl命令行示例就足够了

示例

  • 创建一个名为 test 的队列,将正文设置为 hello world。
    • 注意:[clientId] 这是一个唯一的字符串,用于标识您的订阅,否则将为每个请求创建一个新的使用者,请参阅

  • 弹出队列的消息
    • $curl -X 删除“http://localhost:8161/demo/message/test?type=queue&clientId=consumerA”
    • 您应该看到“Hello World”
  • 最后从队列中取消订阅
    • $curl -d 'action=unsubscribe' "http://localhost:8161/demo/message/test?type=queue&clientId=consumerA"

您应该能够监控所有从 admin 界面进行上述操作

First I assume:

  • You are running activemq 5.5.0
  • You are using the default activemq configuration that enables the web-console
  • By cURL you mean libcurl and a command line example is sufficient

Example:

  • Create a queue named test, set the body to hello world.
    • Note: [clientId] this a unique string to identify your subscribe otherwise a new consumer will be created for each request see REST
    • $ curl -d 'body="Hello World"' "http://localhost:8161/demo/message/test?type=queue&clientId=consumerA"
  • Pop the message of the queue
    • $ curl -X delete "http://localhost:8161/demo/message/test?type=queue&clientId=consumerA"
    • You should see "Hello World"
  • Finally unsubscribe from the queue
    • $ curl -d 'action=unsubscribe' "http://localhost:8161/demo/message/test?type=queue&clientId=consumerA"

You should be able to monitor all of the above operations from the admin interface

兰花执着 2024-10-03 19:14:43

在版本 5.8 之前,REST API 是 Web 示例的一部分并进行了映射
http://localhost:8161/demo/message 网址。从5.8开始,API
默认情况下可在 http://localhost:8161/api/message url

http://activemq.apache.org/rest.html

Until version 5.8, REST API was part of the Web Samples and was mapped
to http://localhost:8161/demo/message url. From 5.8 onwards, the API
is available by default at http://localhost:8161/api/message url

http://activemq.apache.org/rest.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文