【问题标题】:Is it possible to use OpenWire protocol with spring-boot-starter-artemis?是否可以将 OpenWire 协议与 spring-boot-starter-artemis 一起使用?
【发布时间】:2022-11-23 03:02:25
【问题描述】:

我使用spring-boot-starter-artemis 和 JMS 设置了 ActiveMQ Artemis 消费者。我还在本地启动了代理,我的目标是将它们配置为通过 OpenWire 协议进行通信。为了限制与该协议的通信,我修改了 broker.xml (protocols=OPENWIRE) 中的接受器。它看起来像这样:

<acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>

但是,不幸的是我收到以下错误:

org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Failed to create session factory; nested exception is ActiveMQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=AMQ219013: Timed out waiting to receive cluster topology. Group:null]

如何配置客户端以使用 OpenWire 协议?

他们通信的默认协议是什么?在我限制通信之前,Artemis 控制台显示连接已在 CORE 协议上建立,据我所知是集体协议。他们真正以哪个协议为目标进行通信,我该如何检查?

【问题讨论】:

  • 你为什么要“限制通信”到 OpenWire?如果您这样做,那么只有来自 ActiveMQ“Classic”的 OpenWire JMS 客户端才能连接。
  • “集体协议”是什么意思?

标签: jms spring-jms activemq-artemis


【解决方案1】:

您收到 ActiveMQConnectionTimedOutException 的原因是因为您尝试使用 spring-boot-starter-artemis 连接到配置为的 acceptor只要支持 OpenWire 协议。这将绝不工作因为spring-boot-starter-artemis depends on artemis-jms-client这将只要使用 ActiveMQ Artemis“核心”协议,而不是 OpenWire。

您应该在broker.xml 中配置acceptor 以支持核心,例如:

protocols=CORE,OPENWIRE

如果您希望客户端使用 OpenWire,那么您需要使用 ActiveMQ“Classic”中的 OpenWire JMS 客户端库。

【讨论】:

    猜你喜欢
    • 2018-07-07
    • 2018-12-06
    • 2019-10-28
    • 1970-01-01
    • 2020-03-09
    • 2015-02-19
    • 1970-01-01
    • 1970-01-01
    • 2018-10-30
    相关资源
    最近更新 更多