diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2014-02-10 00:30:33 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2014-02-10 00:30:33 +0000 |
commit | 4f64702bcd4da0ce73622ec807d99cc3f50f309b (patch) | |
tree | 5086e4c6ba83807231767f4240a2b786b95c27f9 | |
parent | fe799176e201fd013045287dd1845a37ae05d287 (diff) | |
download | qpid-python-4f64702bcd4da0ce73622ec807d99cc3f50f309b.tar.gz |
QPID-5504 : Fix bug in routeToAlternate which left queue entries in database if there were no alternates to route to
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1566479 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java index 8b81a87903..4ee9df5e5d 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java @@ -369,42 +369,45 @@ public abstract class QueueEntryImpl implements QueueEntry 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) - { - txn = new LocalTransaction(getQueue().getVirtualHost().getMessageStore()); - } - int enqueues = alternateExchange.send(getMessage(), + enqueues = alternateExchange.send(getMessage(), getInstanceProperties(), txn, action); + } + else + { + enqueues = 0; + } - txn.dequeue(currentQueue, getMessage(), new ServerTransaction.Action() + txn.dequeue(currentQueue, getMessage(), new ServerTransaction.Action() + { + public void postCommit() { - public void postCommit() - { - delete(); - } - - public void onRollback() - { - - } - }); + delete(); + } - if(autocommit) + public void onRollback() { - txn.commit(); + } - return enqueues; + }); - } - else + if(autocommit) { - return 0; + txn.commit(); } + return enqueues; + } public boolean isQueueDeleted() |