diff options
| -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() |
