【发布时间】:2021-06-04 23:00:50
【问题描述】:
我们正在尝试从 ActiveMQ 5.x 升级到最新的 Artemis (2.17),但我们的一个应用程序让我们感到悲痛。
该应用程序是使用 STOMP 的较旧的 PHP Web 应用程序。它创建一个临时响应队列,向目标发送消息,然后等待响应。在 ActiveMQ 5.x 下,这可以正常工作(并且已经使用了多年),但在 Artemis 中,请求只会挂起直到超时。
目标是基于 JMS API 和 Openwire 的 Java 应用程序。我们的大多数应用程序都是这样,相互通信没有问题……只有这一个 PHP web 应用程序有问题,而且它似乎是我们唯一基于 STOMP 的东西。
我们单独运行单个事务并启用 Artemis STOMP 调试,这是我们看到的:
07:47:42,180 STOMP(/10.0.0.5:40618, f985f04d): IN << StompFrame[command=CONNECT, headers={login=<appid>, passcode=<app-password>}]
07:47:42,196 STOMP(/10.0.0.5:40618, f985f04d):OUT >> StompFrame[command=CONNECTED, headers={session=f985f04d}]
07:47:42,203 STOMP(/10.0.0.5:40618, f985f04d): IN << StompFrame[command=SUBSCRIBE, headers={ack=client, destination=/temp-queue/Reply-604379ee2f900, activemq.prefetchSize=1}]
07:47:42,235 STOMP(/10.0.0.5:40618, f985f04d): IN << StompFrame[command=SEND, headers={expires=1615035162000, destination=/queue/target, content-type=text/plain, reply-to=/temp-queue/Reply-604379ee2f900}, body=<--- message text---> body-bytes=[<--- message bytes --->, size=0]
07:48:42,247 STOMP(/10.0.0.5:40618, f985f04d): IN << StompFrame[command=DISCONNECT, headers={}]
问题的核心似乎是来自上面显示的“SEND”操作的消息永远不会到达接收者。我们已验证接收器在线,并且它响应其他使用 JMS 和 Openwire 连接进行连接的客户端 - 但此 STOMP 消息未路由到目的地。
如果我们关闭 Artemis 并恢复到 ActiveMQ 5.x,应用程序可以正常工作。
我们使用的是默认配置:
<acceptors>
<!-- useEpoll means: it will use Netty epoll if you are on a system (Linux) that supports it -->
<!-- amqpCredits: The number of credits sent to AMQP producers -->
<!-- amqpLowCredits: The server will send the # credits specified at amqpCredits at this low mark -->
<!-- amqpDuplicateDetection: If you are not using duplicate detection, set this to false
as duplicate detection requires applicationProperties to be parsed on the server. -->
<!-- amqpMinLargeMessageSize: Determines how many bytes are considered large, so we start using files to hold their data.
default: 102400, -1 would mean to disable large mesasge control -->
<!-- Note: If an acceptor needs to be compatible with HornetQ and/or Artemis 1.x clients add
"anycastPrefix=jms.queue.;multicastPrefix=jms.topic." to the acceptor url.
See https://issues.apache.org/jira/browse/ARTEMIS-1644 for more information. -->
<!-- Acceptor for every supported protocol -->
<acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor>
<!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
<acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true</acceptor>
<!-- STOMP Acceptor. -->
<acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
<!-- HornetQ Compatibility Acceptor. Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
<acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
<!-- MQTT Acceptor -->
<acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
</acceptors>
我们需要一些神奇的配置来将这些 STOMP 消息路由到正确的目的地吗?
【问题讨论】:
-
编辑了我的问题以包括我们的接受器配置。
-
@Justin:我很欣赏这次更新,但由于内部安排,我们无法再测试一两个月内的问题应用程序。当我们有机会再次测试时,我肯定会发布另一个更新,当然如果您创建的错误报告得到解决,我们也会尝试更新。
标签: jms stomp activemq-artemis