gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 09:18:52 28 4
gpt4 key购买 nike

我正在尝试连接到 EAP 7.1 上的 ActiveMq Artemis,该 EAP 7.1 具有旧配置(远程:4447)。我可以使用端口 5445 使用 JMSToolBox 进行连接,但是当我想使用 Spring Boot 应用程序中的remote://xxx:4447 到达服务器时,我收到此警告

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

还有很多这样的警告。

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

我无权访问 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;
}

应用程序.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>

最佳答案

EAP 7.1(在 Apache Artemis 1.x 上)和您的客户端代码(在 Apache Artemis 2.10 上)似乎不匹配。

关于java - Spring JMS 无法连接到 JBoss EAP 7.1 ActiveMq Artemis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58597414/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com