gpt4 book ai didi

java - ActiveMQ 抛出不匹配的确认异常

转载 作者:行者123 更新时间:2023-12-05 00:07:13 24 4
gpt4 key购买 nike

WARN | Async error occurred: javax.jms.JMSException: Unmatched acknowledge: MessageAck {commandId = 30, responseRequired = false, ackType = 2, consumerId = ID:PC02-DT-009-52405-1421153309991-1:3:10:1, firstMessageId = ID:PC02-DT-009-52360-1421152976467-1:4:11:1:1, lastMessageId = ID:PC02-DT-009-52360-1421152976467-1:4:11:1:1, destination = queue://DATA.DESTINATION, transactionId = null, messageCount = 1, poisonCause = null}; Could not find Message-ID ID:PC02-DT-009-52360-1421152976467-1:4:11:1:1 in dispatched-list (start of ack)
javax.jms.JMSException: Unmatched acknowledge: MessageAck {commandId = 30, responseRequired = false, ackType = 2, consumerId = ID:PC02-DT-009-52405-1421153309991-1:3:10:1, firstMessageId = ID:PC02-DT-009-52360-1421152976467-1:4:11:1:1, lastMessageId = ID:PC02-DT-009-52360-1421152976467-1:4:11:1:1, destination = queue://DATA.DESTINATION, transactionId = null, messageCount = 1, poisonCause = null}; Could not find Message-ID ID:PC02-DT-009-52360-1421152976467-1:4:11:1:1 in dispatched-list (start of ack)
at org.apache.activemq.broker.region.PrefetchSubscription.assertAckMatchesDispatched(PrefetchSubscription.java:482)
at org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:214)
at org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:426)
at org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:408)
at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:77)
at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:77)
at org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:287)
at org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:87)
at org.apache.activemq.broker.TransportConnection.processMessageAck(TransportConnection.java:508)
at org.apache.activemq.command.MessageAck.visit(MessageAck.java:236)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:329)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:184)
at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:288)
atorg.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)

这是我在 activeMQ 日志中得到的异常。场景:我有 10 个消费者,消费者正在监听的目标队列中有 100 条消息。消费者正在获取大约 10-20 条消息的消息,但最终停止从队列中获取消息并出现上述异常。我的理解是,消费者只会在返回确认时收到一条新消息(如果我是对的)。JMS 容器:

<jms:listener-container container-type="default" connection-factory="jmsConsumerConnectionFactory"
acknowledge="auto">
<jms:listener destination="DATA.DESTINATION" ref="jmsMessageListener" concurrency="10-15" method="onMessage"/>
</jms:listener-container>

非常感谢任何帮助,谢谢!

最佳答案

好吧,让我感谢我自己回答这个问题。显然,消费者在通过 httpclient 连接到数据库时遇到了一些异常,这会杀死所有消费者线程。无论如何,任何遇到此问题且没有任何异常(exception)情况的人都可以尝试通过以下方式解决,1.增加activeMQ配置“conf/activemq.xml”中的内存限制2.尝试将确认方法更改为“已交易”或在消息本身中确认消息.acknowledge();

关于java - ActiveMQ 抛出不匹配的确认异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27928419/

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