代码之家  ›  专栏  ›  技术社区  ›  Spartan

从Spring Boot app连接到JBoss EAP 7.1上部署的队列时收到警告/错误

  •  0
  • Spartan  · 技术社区  · 7 年前

    我在本地机器上运行的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
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Justin Bertram    7 年前

    我认为这里的问题是JBoss EAP 7嵌入了ActiveMQ Artemis代理,但您的依赖关系是用于使用ActiveMQ 5的库。x(即不同的经纪人)。查看pom。xml来自 "Helloworld JMS" quick-start for EAP 7.1

    要清楚,ActiveMQ Artemis 支持5。x客户端,但我认为在EAP中默认情况下禁用该功能。