2 Replies Latest reply on Oct 27, 2010 2:32 PM by qwang_qwang

    javax.jms.JMSException: Unmatched acknowledge

    qwang_qwang

      We are using AMQ 5.3.2 on windows platform. We have a windows service as message consumer. The windows service might spawn up to 20 threads to get messages from the broker. We also have a message bus wrapper singleton, and each thread will invoke the Receive method on the wrapper singleton to get a message from the the broker. We did not set a prefetch count when opening a connection to the broker, thus the prefetch count might be set as the default value 1000.

       

      After keeping the broker running for a couple of weeks, we had the following AMQ exception, which caused the consumer to stop reading messages from broker:

       

      2010-10-19 21:45:44,671 | WARN  | Async error occurred: javax.jms.JMSException: Unmatched acknowledge: MessageAck {commandId = 74974, responseRequired = false, ackType = 2, consumerId = ID:{consumer host name}-3016-634225317490968212-1:0:1:1, firstMessageId = ID:{producer 1 host name}-1761-634230923148507266-1:3:1:1:1261, lastMessageId = ID:{producer 2 host name}-2343-634230664772291390-1:3:1:1:5304, destination = queue://SBLDocument, transactionId = null, messageCount = 2}; Could not find Message-ID ID:{producer 1 host name}-1761-634230923148507266-1:3:1:1:1261 in dispatched-list (start of ack) | org.apache.activemq.broker.TransportConnection.Service | ActiveMQ Transport: tcp:///{broker host name}:3015

      javax.jms.JMSException: Unmatched acknowledge: MessageAck {commandId = 74974, responseRequired = false, ackType = 2, consumerId = ID:{consumer host name}-3016-634225317490968212-1:0:1:1, firstMessageId = ID:{producer 1 host name}-1761-634230923148507266-1:3:1:1:1261, lastMessageId = ID:{producer 2 host name}-2343-634230664772291390-1:3:1:1:5304, destination = queue://SBLDocument, transactionId = null, messageCount = 2}; Could not find Message-ID ID:{producer 1 host name}-1761-634230923148507266-1:3:1:1:1261 in dispatched-list (start of ack)

           at org.apache.activemq.broker.region.PrefetchSubscription.assertAckMatchesDispatched(PrefetchSubscription.java:435)

           at org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:209)

           at org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:373)

           at org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:470)

           at org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:194)

           at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:74)

           at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:74)

           at org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:85)

           at org.apache.activemq.broker.TransportConnection.processMessageAck(TransportConnection.java:452)

           at org.apache.activemq.command.MessageAck.visit(MessageAck.java:205)

           at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:300)

           at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:178)

           at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)

           at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)

           at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:216)

           at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)

           at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:204)

           at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:186)

           at java.lang.Thread.run(Thread.java:619)

       

      We had to restart the windows service to consume messages from the broker again.

       

      I appreciate if someone can explain why we had this unmatched acknowledge error and how to keep it from occurring again.

       

      Thanks,

      Qilong