java—在activemq从属代理成为主代理之后,无法确认来自jms activemq使用者(以http连接)的某些消息

zmeyuzjn  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(528)

我正面临一个我不能完全理解的问题。我有2个activemq代理(主/从-版本5.16.0),其中一个jms生产者和一个jms消费者,都通过http连接到具有以下failoveruri的代理:http://vm-hub-1:61617,http://vm-hub-2:61617
我正在通过多个测试测试高可用性,但以下测试失败:
将消息从生产者注入到virtualtopic的activemq
使用来自消费者的虚拟图片消息
停止activemq主服务器,使从服务器成为主服务器
检查生产者是否仍在注入消息,消费者是否仍在毫无损失地消费。
每次停止activemq主机时,在使用者端都会出现以下错误:

java.io.IOException: Could not post command: MessageAck {commandId = 801, responseRequired = true, ackType = 1, consumerId = ID:adrienc-ThinkPad-T470p-33711-1606767701957-1:5:1:1, firstMessageId = ID:adrienc-ThinkPad-T470p-44545-1606767699632-1:5:1:1:2336, lastMessageId = ID:adrienc-ThinkPad-T470p-44545-1606767699632-1:5:1:1:2336, destination = queue://Consumer.consumer_1.VirtualTopic.VIRTUALTOPIC_1, transactionId = null, messageCount = 1, poisonCause = java.lang.Throwable: Suppressing duplicate delivery on connection, consumer ID:adrienc-ThinkPad-T470p-33711-1606767701957-1:5:1:1} due to: java.io.IOException: Failed to post command: MessageAck {commandId = 801, responseRequired = true, ackType = 1, consumerId = ID:adrienc-ThinkPad-T470p-33711-1606767701957-1:5:1:1, firstMessageId = ID:adrienc-ThinkPad-T470p-44545-1606767699632-1:5:1:1:2336, lastMessageId = ID:adrienc-ThinkPad-T470p-44545-1606767699632-1:5:1:1:2336, destination = queue://Consumer.consumer_1.VirtualTopic.VIRTUALTOPIC_1, transactionId = null, messageCount = 1, poisonCause = java.lang.Throwable: Suppressing duplicate delivery on connection, consumer ID:adrienc-ThinkPad-T470p-33711-1606767701957-1:5:1:1} as response was: HttpResponseProxy{HTTP/1.1 500 Server Error [Server: nginx, Date: Mon, 30 Nov 2020 20:22:22 GMT, Content-Type: text/html;charset=iso-8859-1, Transfer-Encoding: chunked, Connection: keep-alive, Cache-Control: must-revalidate,no-cache,no-store, Strict-Transport-Security: max-age=31536000; includeSubDomains] ResponseEntityProxy{[Content-Type: text/html;charset=iso-8859-1,Chunked: true]}}
    at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:34) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.http.HttpClientTransport.oneway(HttpClientTransport.java:139) ~[activemq-http-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:335) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:317) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.failover.FailoverTransport.oneway(FailoverTransport.java:668) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:86) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1392) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1436) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQSession.syncSendPacket(ActiveMQSession.java:2095) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQSession.sendAck(ActiveMQSession.java:2249) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQSession.sendAck(ActiveMQSession.java:2242) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQMessageConsumer.posionAck(ActiveMQMessageConsumer.java:548) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1486) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) ~[activemq-client-5.16.0.jar:5.16.0]
    at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) ~[activemq-client-5.16.0.jar:5.16.0]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.io.IOException: Failed to post command: MessageAck {commandId = 801, responseRequired = true, ackType = 1, consumerId = ID:adrienc-ThinkPad-T470p-33711-1606767701957-1:5:1:1, firstMessageId = ID:adrienc-ThinkPad-T470p-44545-1606767699632-1:5:1:1:2336, lastMessageId = ID:adrienc-ThinkPad-T470p-44545-1606767699632-1:5:1:1:2336, destination = queue://Consumer.consumer_1.VirtualTopic.VIRTUALTOPIC_1, transactionId = null, messageCount = 1, poisonCause = java.lang.Throwable: Suppressing duplicate delivery on connection, consumer ID:adrienc-ThinkPad-T470p-33711-1606767701957-1:5:1:1} as response was: HttpResponseProxy{HTTP/1.1 500 Server Error [Server: nginx, Date: Mon, 30 Nov 2020 20:22:22 GMT, Content-Type: text/html;charset=iso-8859-1, Transfer-Encoding: chunked, Connection: keep-alive, Cache-Control: must-revalidate,no-cache,no-store, Strict-Transport-Security: max-age=31536000; includeSubDomains] ResponseEntityProxy{[Content-Type: text/html;charset=iso-8859-1,Chunked: true]}}
    at org.apache.activemq.transport.http.HttpClientTransport.oneway(HttpClientTransport.java:129) ~[activemq-http-5.16.0.jar:5.16.0]
    ... 20 common frames omitted

一旦发生此错误,所有其他消息都会卡在activemq代理中,因为有一条消息没有得到正确的确认。
感觉我的消费者无法向新的主代理确认一条消息。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题