【问题标题】:Getting a warning/error when connecting to queue deployed on JBoss EAP 7.1 from Spring-Boot app从 Spring-Boot 应用程序连接到部署在 JBoss EAP 7.1 上的队列时收到警告/错误
【发布时间】:2018-03-27 21:27:56
【问题描述】:

我在本地机器上运行的 JBoss EAP 7.1 服务器上部署了一个 activemq 队列(QueueA)。我有一个 Spring-Boot 应用程序,它也在同一台机器上运行,并且有一个用于实现“MessageListener”的队列的侦听器。我在 Spring-Boot 应用程序中使用了以下依赖项:

1. <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
</dependency>

2.
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
</dependency>

3.
<dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
</dependency>

I have created connection factory the following way : 
ActiveMQConnectionFactory connectionFactory =
                new ActiveMQConnectionFactory();

        connectionFactory.setBrokerURL(tcp://localhost:8080);
        connectionFactory.setUserName("Username");
        connectionFactory.setPassword("Password");

Now when I start my Spring-Boot app it gives me the following error initially :
ERROR : Not Connected: [ClusterNode]

and following error repetitively until I stop the app:

ERROR : DefaultMessageListenerContainer: Error : Could not refresh JMS Connection for destination 'QueueA'.Cause: Cannot send, channel has already failed: tcp://127.0.0.1:8080


Can anyone please help in this regard ? or Point me to some documentation which would be helpful

【问题讨论】:

  • 是否涉及堆栈跟踪?如果是这样,请将其包含在您的问题中。如果没有,请详细说明应用程序在一般情况下正在做什么,特别是在发生错误时应用程序在做什么。

标签: spring-boot jboss7.x spring-jms activemq-artemis


【解决方案1】:

我认为这里的问题是 JBoss EAP 7 嵌入了 ActiveMQ Artemis 代理,但您的依赖项是用于与 ActiveMQ 5.x 一起工作的库(即不同的代理)。查看来自"Helloworld JMS" quick-start for EAP 7.1 的 pom.xml。

需要明确的是,ActiveMQ Artemis确实支持 5.x 客户端,但我相信 EAP 中默认禁用该功能。

【讨论】:

  • 感谢您将我指向该 github 资源。但是资源对我没有帮助。我还是有同样的问题
  • 你还在使用org.apache.activemq:activemq-broker依赖吗?
  • 我正在使用这个:com.redhat.jbossjboss-client7​​.1.1依赖>
  • 你从哪里得到com.redhat.jboss:jboss-client?我链接的快速入门中的 pom.xml 使用的是org.jboss.eap:wildfly-jms-client-bom。无论如何,如果您不再使用 org.apache.activemq:activemq-broker 依赖项,那么您使用 ActiveMQ 5.x 连接工厂实现粘贴的代码不应再编译(如预期的那样)。这就是你现在遇到的问题吗?如果没有,你遇到了什么问题?
  • 我没有使用任何 spring active mq 依赖项。我的一个朋友建议从 spring 中排除一些可能与 JBoss 依赖项冲突的工件,并使用前面评论中提到的 JBoss 依赖项。在使用“DefaultMessageListenerContainer”之前,我已经在您指出的文章中创建了具有相同属性的连接工厂。现在我收到以下错误:无法刷新目标“QueueA”的 JMS 连接。原因:AMQ119031:无法验证用户
猜你喜欢
  • 2018-11-19
  • 2020-02-12
  • 2020-02-24
  • 1970-01-01
  • 2020-10-08
  • 2020-03-09
  • 1970-01-01
  • 1970-01-01
  • 2017-05-11
相关资源
最近更新 更多