You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by st...@apache.org on 2006/10/06 12:14:28 UTC

svn commit: r453539 - in /incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue: AMQMessage.java SubscriptionImpl.java

Author: steshaw
Date: Fri Oct  6 03:14:27 2006
New Revision: 453539

URL: http://svn.apache.org/viewvc?view=rev&rev=453539
Log:
QPID-16 Removed unnecessary requeue operations.

Modified:
    incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/AMQMessage.java
    incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/SubscriptionImpl.java

Modified: incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/AMQMessage.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/AMQMessage.java?view=diff&rev=453539&r1=453538&r2=453539
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/AMQMessage.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/AMQMessage.java Fri Oct  6 03:14:27 2006
@@ -283,54 +283,6 @@
         }
     }
 
-    /**
-     * Used to requeue a message (on delivery where an acknowledgement is
-     * expected). This will move it to the end of the queue.
-     */
-    public void requeue(AMQQueue queue) throws AMQException
-    {
-        if(isPersistent() && queue.isDurable())
-        {
-            if(!_store.inTran())
-            {
-                //if not already in tran, want to be so this is atomic
-                _store.beginTran();
-                try
-                {
-                    requeueImpl(queue);
-                    _store.commitTran();
-                }
-                catch(AMQException e)
-                {
-                    _store.abortTran();
-                }
-            }
-            else
-            {
-                //May already be in tran (e.g. if this is called during delivery
-                //resulting from a commit).
-                requeueImpl(queue);
-            }
-        }
-    }
-
-    private void requeueImpl(AMQQueue queue) throws AMQException
-    {
-        try
-        {
-            _store.dequeueMessage(queue.getName(), _messageId);
-            _store.enqueueMessage(queue.getName(), _messageId);
-        }
-        catch(AMQException e)
-        {
-            throw e;
-        }
-        catch(Throwable t)
-        {
-            throw new AMQException("Failure on requeue of message", t);
-        }
-    }
-
     public boolean isPersistent() throws AMQException
     {
         if(_contentHeaderBody == null)

Modified: incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/SubscriptionImpl.java?view=diff&rev=453539&r1=453538&r2=453539
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/SubscriptionImpl.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/org/apache/qpid/server/queue/SubscriptionImpl.java Fri Oct  6 03:14:27 2006
@@ -147,12 +147,6 @@
                 msg.decrementReference();
                 msg.dequeue(queue);
             }
-            else
-            {
-                //move the msg to the back of the persistently recorded queue while
-                //witing for ack
-                msg.requeue(queue);
-            }
         }
         else
         {