activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-5352
Date Tue, 09 Sep 2014 18:19:47 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 7ca25965d -> c70d75213


https://issues.apache.org/jira/browse/AMQ-5352

Applied and tested, all tests still passing after this change.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/c70d7521
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/c70d7521
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/c70d7521

Branch: refs/heads/trunk
Commit: c70d75213ee630e8e1328fd573397a24ce47a4e9
Parents: 7ca2596
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Sep 9 14:19:39 2014 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Sep 9 14:19:39 2014 -0400

----------------------------------------------------------------------
 .../activemq/transport/amqp/AmqpProtocolConverter.java | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/c70d7521/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
----------------------------------------------------------------------
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 caf2083..af1e331 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();
                             }
 


Mime
View raw message