Author: rupertlssmith
Date: Wed Sep 19 06:24:50 2007
New Revision: 577300

URL: http://svn.apache.org/viewvc?rev=577300&view=rev
Log:
Merged revisions 575811 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1

........
  r575811 | ritchiem | 2007-09-14 23:47:52 +0100 (Fri, 14 Sep 2007) | 1 line
  
  QPID-531 : NO_ACK fix. Added a decrementReference in SubscriptionImpl after 
the message has been sent. This was previously done inside dequeueMessage() but 
when the reference counting was reworked earlier in the year it was moved out 
of that method.. but all the uses of dequeueMessage were not evaluated. The 
existing AckTest didon't detect this error as it only occurs with persistent 
messages which the client sends by default. The AckTest however only tests 
transient messages. Updated Test for NO_ACK raised JIRA QPID-602 to cover 
updating the rest of the AckTests
........

Modified:
    incubator/qpid/branches/M2.0.0.0_patch/   (props changed)
    
incubator/qpid/branches/M2.0.0.0_patch/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
    
incubator/qpid/branches/M2.0.0.0_patch/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java

Propchange: incubator/qpid/branches/M2.0.0.0_patch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep 19 06:24:50 2007
@@ -1 +1 @@
-/incubator/qpid/branches/M2.1:447994-563986,574902,575738
+/incubator/qpid/branches/M2.1:447994-563986,574902,575738,575811

Modified: 
incubator/qpid/branches/M2.0.0.0_patch/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2.0.0.0_patch/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java?rev=577300&r1=577299&r2=577300&view=diff
==============================================================================
--- 
incubator/qpid/branches/M2.0.0.0_patch/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
 (original)
+++ 
incubator/qpid/branches/M2.0.0.0_patch/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
 Wed Sep 19 06:24:50 2007
@@ -307,7 +307,12 @@
                 }
 
                 protocolSession.getProtocolOutputConverter().writeDeliver(msg, 
channel.getChannelId(), deliveryTag, consumerTag);
-
+                               
+                if (!_acks)
+                {
+                    msg.decrementReference(storeContext);
+                }
+                               
             }
         }
         finally

Modified: 
incubator/qpid/branches/M2.0.0.0_patch/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2.0.0.0_patch/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java?rev=577300&r1=577299&r2=577300&view=diff
==============================================================================
--- 
incubator/qpid/branches/M2.0.0.0_patch/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
 (original)
+++ 
incubator/qpid/branches/M2.0.0.0_patch/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
 Wed Sep 19 06:24:50 2007
@@ -187,6 +187,25 @@
         UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
         assertTrue(map.size() == 0);
         assertTrue(_messageStore.getMessageMetaDataMap().size() == 0);
+        assertTrue(_messageStore.getContentBodyMap().size() == 0);
+
+    }
+
+    /**
+     * Tests that in no-ack mode no messages are retained
+     */
+    public void testPersistentNoAckMode() throws AMQException
+    {
+        // false arg means no acks expected
+        _subscription = new SubscriptionImpl(5, _protocolSession, 
DEFAULT_CONSUMER_TAG, false);
+        final int msgCount = 10;
+        publishMessages(msgCount, true);
+
+        UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
+        assertTrue(map.size() == 0);
+        assertTrue(_messageStore.getMessageMetaDataMap().size() == 0);
+        assertTrue(_messageStore.getContentBodyMap().size() == 0);
+
     }
 
     /**


Reply via email to