1
votes

I am trying to connect to ActiveMq Artemis on EAP 7.1 which has legacy config (remote:4447). 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

Setup of JMS message listener invoker failed for destination 'java:/queue/party' - trying to recover. 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

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

I don't have the access to the JBoss server but I am told that the config is fine. 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

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:

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

1 Answers

0
votes

It looks like a mismatch between EAP 7.1 (on Apache Artemis 1.x) and your client code (on Apache Artemis 2.10).