diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2014-02-10 00:36:55 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2014-02-10 00:36:55 +0000 |
commit | da6682c48f6e384c08f1a8d881da0612af3fb69e (patch) | |
tree | 4a1dae42841cb99dc180c98b84784d42a0fdb8b8 | |
parent | d9ed5bf6152fe743928f18c1c821197072d89964 (diff) | |
download | qpid-python-da6682c48f6e384c08f1a8d881da0612af3fb69e.tar.gz |
Fix QueueEntry routeToAlternate bug
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/java-broker-amqp-1-0-management@1566480 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java index 8b6968b2cf..173705c0f7 100644 --- a/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java +++ b/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java @@ -368,42 +368,44 @@ public abstract class QueueEntryImpl<E extends QueueEntryImpl<E,Q,L>, Q extends final AMQQueue currentQueue = getQueue(); Exchange alternateExchange = currentQueue.getAlternateExchange(); boolean autocommit = txn == null; + int enqueues; + + if(autocommit) + { + txn = new LocalTransaction(getQueue().getVirtualHost().getMessageStore()); + } + if (alternateExchange != null) { - if(autocommit) + enqueues = alternateExchange.send(getMessage(), + getInstanceProperties(), + txn, + action); + } + else + { + enqueues = 0; + } + + txn.dequeue(currentQueue, getMessage(), new ServerTransaction.Action() + { + public void postCommit() { - txn = new LocalTransaction(getQueue().getVirtualHost().getMessageStore()); + delete(); } - int enqueues = alternateExchange.send(getMessage(), - getInstanceProperties(), - txn, - action); - - txn.dequeue(currentQueue, getMessage(), new ServerTransaction.Action() + public void onRollback() { - public void postCommit() - { - delete(); - } - - public void onRollback() - { - - } - }); - if(autocommit) - { - txn.commit(); } - return enqueues; + }); - } - else + if(autocommit) { - return 0; + txn.commit(); } + + return enqueues; } public boolean isQueueDeleted() |