diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2014-10-27 19:02:01 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2014-10-27 19:02:01 +0000 |
| commit | 4d7e5969c61eb33aed35e5beeea314efa2e954dd (patch) | |
| tree | c329f343caec193206d258f97c0b7c966cdd5c10 /qpid/java/broker-plugins | |
| parent | 02fb5003ae7c0d9a517f5a4ee530e2b9401c6c59 (diff) | |
| download | qpid-python-4d7e5969c61eb33aed35e5beeea314efa2e954dd.tar.gz | |
QPID-6190 : [Java Broker] [AMQP 1.0] Fix transactional sending to QueueDestination
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1634645 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
| -rw-r--r-- | qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/QueueDestination.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/QueueDestination.java b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/QueueDestination.java index 4fefbe9f7d..4d26890e72 100644 --- a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/QueueDestination.java +++ b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/QueueDestination.java @@ -21,12 +21,11 @@ package org.apache.qpid.server.protocol.v1_0; import org.apache.log4j.Logger; + import org.apache.qpid.amqp_1_0.type.Outcome; import org.apache.qpid.amqp_1_0.type.messaging.Accepted; - -import org.apache.qpid.server.message.MessageSource; +import org.apache.qpid.server.message.MessageReference; import org.apache.qpid.server.queue.AMQQueue; - import org.apache.qpid.server.txn.ServerTransaction; public class QueueDestination extends MessageSourceDestination implements SendingDestination, ReceivingDestination @@ -51,16 +50,24 @@ public class QueueDestination extends MessageSourceDestination implements Sendin txn.enqueue(getQueue(),message, new ServerTransaction.Action() { + MessageReference _reference = message.newReference(); public void postCommit() { - getQueue().enqueue(message,null); + try + { + getQueue().enqueue(message, null); + } + finally + { + _reference.release(); + } } public void onRollback() { - // NO-OP + _reference.release(); } }); |
