简体   繁体   English

Spring JMS 无法连接到 JBoss EAP 7.1 ActiveMq Artemis

[英]Spring JMS can't connect to JBoss EAP 7.1 ActiveMq Artemis

I am trying to connect to ActiveMq Artemis on EAP 7.1 which has legacy config (remote:4447).我正在尝试连接到具有旧配置(远程:4447)的 EAP 7.1 上的 ActiveMq Artemis。 I can connect using JMSToolBox using port 5445 but when I want reach the server using the remote://xxx:4447 from my Spring Boot application I get this warning我可以使用端口 5445 使用 JMSToolBox 进行连接,但是当我想使用来自 Spring 引导应用程序的 remote://xxx:4447 访问服务器时,我收到此警告

Setup of JMS message listener invoker failed for destination 'java:/queue/party' - trying to recover.目标“java:/queue/party”的 JMS 消息侦听器调用程序设置失败 - 尝试恢复。 Cause: org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage_V2 cannot be cast to org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage_V3原因: org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage_V2 无法转换为 org.apache.activemq.artemis.core.protocolQueryResponse_core_3.impl.wireformat.VQueueQueryResponse_V2

And a lot of this warnings.还有很多这样的警告。

AMQ212052: Packet PACKET(SessionQueueQueryResponseMessage_V2)[type=-7, channelID=13, packetObject=SessionQueueQueryResponseMessage_V2, address=null, name=null, consumerCount=0, filterString=null, durable=false, exists=false, temporary=false, messageCount=0, autoCreationEnabled=false] was answered out of sequence due to a previous server timeout and it's being ignored AMQ212052:数据包 PACKET(SessionQueueQueryResponseMessage_V2)[type=-7,channelID=13,packetObject=SessionQueueQueryResponseMessage_V2,address=null,name=null,consumerCount=0,filterString=null,durable=false,exists=false,temporary=false,messageCount =0, autoCreationEnabled=false] 由于先前的服务器超时而被无序回答并且被忽略

I don't have the access to the JBoss server but I am told that the config is fine.我无权访问 JBoss 服务器,但有人告诉我配置很好。 This is my configuration.这是我的配置。

@Bean
public ConnectionFactory connectionFactory() {
    final Hashtable<String, Object> env = new Hashtable<>();
    env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
    env.put(Context.PROVIDER_URL, providerUrl);
    env.put("jboss.naming.client.ejb.context", true);
    env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

    try {
        final Context ctx = new InitialContext(env);
        final String cfLookupName = "jms/RemoteConnectionFactory";

        final ConnectionFactory factory = (ConnectionFactory) ctx.lookup(cfLookupName);
        ctx.close();
        return factory;
    }
    catch (final NamingException e) {
        LOGGER.error(String.format("Error while connecting to JMS. %s", e));
    }
    return null;
}

@Bean
public JmsListenerContainerFactory<?> jmsConnectionFactory(
        final ConnectionFactory connectionFactory,
        final DefaultJmsListenerContainerFactoryConfigurer configurer) {
    final DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    configurer.configure(factory, connectionFactory);
    return factory;
}

application.yml应用程序.yml

jms:
  context-factory: org.wildfly.naming.client.WildFlyInitialContextFactory
  provider-url: remote://<hostname>:4447

I am not sure it is relevant, but I am using this dependency in Maven:我不确定它是否相关,但我在 Maven 中使用此依赖项:

    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-jms-client-bom</artifactId>
    <version>18.0.0.Final</version>
    <type>pom</type>

It looks like a mismatch between EAP 7.1 (on Apache Artemis 1.x) and your client code (on Apache Artemis 2.10). EAP 7.1(在 Apache Artemis 1.x 上)和您的客户端代码(在 Apache Artemis 2.10 上)之间看起来不匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM