From c70d75213ee630e8e1328fd573397a24ce47a4e9 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Tue, 9 Sep 2014 14:19:39 -0400 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-5352 Applied and tested, all tests still passing after this change. --- .../transport/amqp/AmqpProtocolConverter.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java index caf20830c6..af1e331a10 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java @@ -601,7 +601,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { LOG.trace("Inbound Message:{} from Producer:{}", message.getMessageId(), producerId + ":" + messageId.getProducerSequenceId()); - DeliveryState remoteState = delivery.getRemoteState(); + final DeliveryState remoteState = delivery.getRemoteState(); if (remoteState != null && remoteState instanceof TransactionalState) { TransactionalState s = (TransactionalState) remoteState; long txid = toLong(s.getTxnId()); @@ -639,7 +639,16 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { receiver.flow(prefetch - receiver.getCredit()); } - delivery.disposition(Accepted.getInstance()); + if (remoteState != null && remoteState instanceof TransactionalState) { + TransactionalState txAccepted = new TransactionalState(); + txAccepted.setOutcome(Accepted.getInstance()); + txAccepted.setTxnId(((TransactionalState) remoteState).getTxnId()); + + delivery.disposition(txAccepted); + } else { + delivery.disposition(Accepted.getInstance()); + } + delivery.settle(); }