Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus
This is a repost since the initial message was not accepted on the mailing list.
I am doing an integration between OSB (Oracle Service Bus) and ActiveMQ (version 5.9.0 and 5.15.0). Basically I want to dequeue messages stored in an ActiveMQ queue and store them in a Weblogic queue. The dequeuing is initiated from the OSB side by a proxy (which under the hood uses an MDB) and this is configured to be XA enabled.
In order to be able to connect from OSB to ActiveMQ I defined a ForeignJNDIProvider at the Weblogic level (where the OSB runs) and in this ForeignJNDIProvider I mapped the ActiveMQ XAConnectionFactory and the queue I am using.
I want the flow to run in a XA transaction between the ActiveMQ and the JSM Server at Weblogic level. After the config is in place if I put a message in the queue everything looks OK, the message is dequeued, processed correctly and the transaction is committed OK. After this, if I enqueue 10 new messages in ActiveMQ (via the web console) I get the following message in the ActiveMQ logs and the majority of the messages remain in ActiveMQ (some get dequeued but most remain):
2017-01-24 10:37:26,790 | WARN | Async error occurred: javax.jms.JMSException: Unmatched acknowledge: MessageAck [ackType=2, consumerId=ID:hostname-54889-1485178975287-2653:1:3:1, firstMessageId=ID:D02DI1441258DIT-65515-1485250604824-4:1:1:1:2, lastMessageId=ID:D02DI1441258DIT-65515-1485250604824-4:1:1:1:9, destination=queue://TestQueue, transactionId=XID:[48801,globalId=13ffffff8a1a949155ffffffc9ffffffc331,branchId=7765626c6f6769632e656a622e636f6e7461696e65722e4a4d53436f6e6e656374696f6e506f6c6c65722e52657175657374454a4234323034333237ffffffb5fffffffeffffffe4ffffffbd], messageCount=2, poisonCause=null, consumerKey=null]; Could not find Message-ID ID:D02DI1441258DIT-65515-1485250604824-4:1:1:1:2 in dispatched-list (start of ack) | org.apache.activemq.broker.TransportConnection.Service | ActiveMQ Transport: tcp:///22.214.171.124:58575@61616
I downloaded the ActiveMQ code (version 15.5.0) and added a new log call in method assertAckMatchesDispatched to print the received MessageAck (i also tried WireShark but I couldn't get the whole message ID from the dump) and from it it looks like ActiveMQ receives an ACK starting from a message ID that is not present in the current transaction but was part of the previous transaction.
If I use the non-xa connection factory via I have no issues in the flow, everything is OK.
Has anybody encountered something similar? I tried version 5.9.0 and version 5.15.0 and the problem appears in both versions. It looks like the issue might reside in the OSB/Weblogic side but I am curious if anybody encountered something similar.
Re: Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus
The jms.prefetchPolicy.all=0 is not work for me. if I set jms.prefetchPolicy.all=0, the MDBs can't consume messages. My activemq is Master-slave(using embeded borker in jboss), the consumers(MDBs) are distrubited in cluster nodes.
When broker fails, new master is starting up. there is unmatched acknowledge error information in log files