我正在尝试连接到EAP7.1上的ActiveMq Artemis,它具有遗留配置(远程:4447)。我可以使用端口5445使用JMSToolBox进行连接,但是当我想通过远程://xxx:4447从我的Spring应用程序到达服务器时,我会收到以下警告
消息侦听器调用器的JMS调用程序的设置对于目标'java:/queue/party‘失败--试图恢复。原因:无法将org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage_V2转换为org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage_V3
还有很多这样的警告。
PACKET(SessionQueueQueryResponseMessage_V2)type=-7,AMQ212052: Packet
channelID=13,packetObject=SessionQueueQueryResponseMessage_V2,address=null,name=null,consumerCount=0,filterString=null,durable=false,exists=false,temporary=false,messageCount=0,autoCreationEnabled=false由于先前的服务器超时而被排除在外,因此被忽略了。
我没有访问JBoss服务器的权限,但我被告知配置没有问题。这是我的配置。
@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我不确定它是否相关,但我在Maven中使用了这个依赖项:
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jms-client-bom</artifactId>
<version>18.0.0.Final</version>
<type>pom</type>发布于 2019-10-29 12:36:14
它看起来像是EAP7.1(在Artemis 1.x上)和客户机代码(在Artemis 2.10上)之间的不匹配。
https://stackoverflow.com/questions/58597414
复制相似问题