activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r835325 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/broker/region/RegionBroker.java test/java/org/apache/activemq/broker/MessageExpirationTest.java test/java/org/apache/activemq/usecases/ExpiredMessagesTest.java
Date Thu, 12 Nov 2009 10:40:58 GMT
Author: gtully
Date: Thu Nov 12 10:40:58 2009
New Revision: 835325

URL: http://svn.apache.org/viewvc?rev=835325&view=rev
Log:
resolve https://issues.apache.org/activemq/browse/AMQ-2487, patch applied, test added

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?rev=835325&r1=835324&r2=835325&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
Thu Nov 12 10:40:58 2009
@@ -723,7 +723,11 @@
 							                .getDestination());
 							if (context.getBroker()==null) {
 								context.setBroker(getRoot());
-							}
+							}                        
+							                           
+							// Clear out the memory usage for the old queue. 
+							// We'll reset it to the DLQ below:
+							message.setMemoryUsage(null);
 							BrokerSupport.resendNoCopy(context,message,
 							        deadLetterDestination);
 						}

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java?rev=835325&r1=835324&r2=835325&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
Thu Nov 12 10:40:58 2009
@@ -19,8 +19,8 @@
 import javax.jms.DeliveryMode;
 
 import junit.framework.Test;
+
 import org.apache.activemq.broker.region.policy.PolicyEntry;
-import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConnectionInfo;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesTest.java?rev=835325&r1=835324&r2=835325&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesTest.java
Thu Nov 12 10:40:58 2009
@@ -172,6 +172,10 @@
         });
         assertEquals("dlq contains all expired", totalExpiredCount, dlqView.getQueueSize());
         
+        // memory check
+        assertEquals("memory usage is back to duck egg", 0, view.getMemoryPercentUsage());
+        assertTrue("memory usage is increased ", 0 < dlqView.getMemoryPercentUsage());
   
+        
         // verify DQL
         MessageConsumer dlqConsumer = createDlqConsumer(connection);
         int count = 0;



Mime
View raw message