Quantcast

Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus

ionut.marin
Hello,

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:///158.168.3.55: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.

2017-01-24 10:37:26,787 | DEBUG | assertAckMatchesDispatched() - Received MessageAck: [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]]. | org.apache.activemq.broker.region.PrefetchSubscription | ActiveMQ Transport: tcp:///IP:58575@61616

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.

Thank you,
Ionut.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus

aphor
This post was updated on .
Hi ionut.marin,
Did you get solution? I got similar failover issue (Unmatched acknowledge: MessageAck) and posted at http://activemq.2283324.n4.nabble.com/Messages-stuck-in-queue-after-failover-td4719934.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus

ionut.marin
Hello aphor,

I managed to get it working by doing the following 2 things:

1. In the JNDI provider on the Weblogic server in the provider URL I used the property jms.prefetchPolicy.all=0 i.e. tcp://<hostname>:61616?jms.prefetchPolicy.all=0
2. In the OSB proxy flow if you have a "Service Callout" or a "Publish" action anywhere in the flow make sure that you use a "Routing Options" in which you set "Exactly Once" for QoS.

I am still testing but after these changes I didn't see the issue anymore.

Let me know if this works for you also.

Regards,
Ionut.



On Fri, Feb 10, 2017 at 2:55 AM, aphor [via ActiveMQ] <[hidden email]> wrote:
Did you get solution? I got similar issue and post at http://activemq.2283324.n4.nabble.com/Messages-stuck-in-queue-after-failover-td4719934.html


To unsubscribe from Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unmatched acknowledge: MessageAck (start of ack) in XA transaction initiated by Oracle Service Bus

aphor
Hello Ionut,

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

Regards,
Aphor
Loading...