You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2014/02/10 01:36:56 UTC

svn commit: r1566480 - /qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java

Author: rgodfrey
Date: Mon Feb 10 00:36:55 2014
New Revision: 1566480

URL: http://svn.apache.org/r1566480
Log:
Fix QueueEntry routeToAlternate bug

Modified:
    qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java

Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java?rev=1566480&r1=1566479&r2=1566480&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java Mon Feb 10 00:36:55 2014
@@ -368,42 +368,44 @@ public abstract class QueueEntryImpl<E e
         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()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org