【问题标题】:How to test the connection to RabbitMQ Server?如何测试与 RabbitMQ 服务器的连接?
【发布时间】:2018-09-25 09:10:20
【问题描述】:

我有以下问题: 我需要测试与 AMQ 协议 上运行的 RabbitMQ 服务器 的连接,并且我需要使用 CMD 或类似的东西来完成它,所以我可以从脚本执行命令。我不知道这是否可能,我在互联网上发现的唯一东西是通过 HTTP 测试连接,它对我不起作用。所以很快,我需要 cmd 命令来测试与使用的 RabbitMQ 服务器的连接AMQP。

我希望有人明白我的问题是什么,也许我描述得不好。

提前致谢。

【问题讨论】:

  • 你从github.com/mariuszwojcik/RabbitMQTools看过Get-RabbitMQConnection吗?运行 cmd.exe cam 的现代机器也有(可能已经有)powershell.exe。
  • 您在这里提供的帖子实际上取得了一点进展,因为我不知道这个存储库,但这仍然不是我的问题的真正解决方案。
  • 在 cmd.exe shell 中,命令 powershell -NoProfile -Command "Get-RabbitMQConnection ..." 是否会识别 RabbitMQ 是否正常工作?
  • 在尝试执行您在此处提供的命令后,我收到此错误Get-RabbitMQConnection : The term 'Get-RabbitMQConnection' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-RabbitMQConnection + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-RabbitMQConnection:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
  • 你安装了RabbitMQTools吗?请参阅该页面上的Getting Started 部分。

标签: cmd rabbitmq amqp


【解决方案1】:

我找出了问题所在,这有点傻。你需要先建立连接,但在本地机器上做起来有点棘手。简单地说,在这种情况下,您需要模拟两个脚本之间的通信。然后,很容易用命令列出连接:

rabbitmqctl list_connections

【讨论】:

  • 很高兴听到您找到答案。 RabbitMQTools 可能仍然有用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-04
  • 1970-01-01
  • 2017-09-29
  • 2020-07-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多