Spring JMS Baeldung教程代码无法连接到ActiveMQ。

huangapple go评论80阅读模式
英文:

Spring JMS Baeldung tutorial code cannot connect to ActiveMQ

问题

我已成功构建了来自此存储库的示例代码。然而,当我运行此测试应用程序时,我收到以下错误:
ERROR | 无法刷新目的地为'queue-1'的JMS连接 - 重试使用FixedBackOff{interval=5000, currentAttempts=2, maxAttempts=unlimited}。原因:无法连接到代理程序URL:tcp://localhost:61616。原因:java.net.ConnectException:拒绝连接:没有进一步的信息
我不确定从哪里开始排查。我尝试在我的工作PC和一个EC2 Windows实例上运行它,以确保不是公司防火墙之类的问题。结果在两台机器上都相同。

英文:

I have successfully built example code from this repo. However, when I run this testing application I get the following error:

ERROR | Could not refresh JMS Connection for destination 'queue-1' - retrying using FixedBackOff{interval=5000, currentAttempts=2, maxAttempts=unlimited}. Cause: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: no further information

I'm not sure where to start troubleshooting. I tried it on my work PC and on an EC2 Windows instance to make sure it's not my company firewall or something like that. Result is the same on both machines.

答案1

得分: 0

为了启动嵌入式的 ActiveMQ 代理,我需要运行项目中包含的单元测试。

单元测试包括代理初始化:

public static EmbeddedActiveMQBroker embeddedBroker = new EmbeddedActiveMQBroker();
英文:

To start the embedded ActiveMQ broker I needed to run unit tests included with the project.

The unit test included broker initialization:

public static EmbeddedActiveMQBroker embeddedBroker = new EmbeddedActiveMQBroker();

huangapple
  • 本文由 发表于 2023年6月22日 02:52:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76526311.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定