I found out why the msg ack with transactionId=null was sent after the XA transaction finished processing the same message. When the MessageConsumer is closed, the method ActiveMQMessageConsumer.deliverAcks() is called. There is a check if a session's ack mode is auto acknowledge, if the isAutoAcknowledgeEach() is true, the ack is send (even when the session is transacted):
void deliverAcks() { MessageAck ack = null; if (deliveryingAcknowledgements.compareAndSet(false, true)) { if (isAutoAcknowledgeEach()) {... } This check isAutoAcknowledgeEach is always true for any XA transaction, because ActiveMQXASession has its method isAutoAcknowledge always returning true. Please just let me know if this is a bug, or I am doing something totally wrong. Tnx. -- View this message in context: http://activemq.2283324.n4.nabble.com/Duplicate-acknowledge-when-using-XA-transactions-tp4661141p4661157.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.