git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-5.3@835329 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-11-12 10:48:39 +00:00
parent e150757421
commit 2a07b408ee
3 changed files with 10 additions and 2 deletions

View File

@ -723,7 +723,11 @@ public class RegionBroker extends EmptyBroker {
.getDestination()); .getDestination());
if (context.getBroker()==null) { if (context.getBroker()==null) {
context.setBroker(getRoot()); 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, BrokerSupport.resendNoCopy(context,message,
deadLetterDestination); deadLetterDestination);
} }

View File

@ -19,8 +19,8 @@ package org.apache.activemq.broker;
import javax.jms.DeliveryMode; import javax.jms.DeliveryMode;
import junit.framework.Test; import junit.framework.Test;
import org.apache.activemq.broker.region.policy.PolicyEntry; 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.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ConnectionInfo; import org.apache.activemq.command.ConnectionInfo;

View File

@ -172,6 +172,10 @@ public class ExpiredMessagesTest extends CombinationTestSupport {
}); });
assertEquals("dlq contains all expired", totalExpiredCount, dlqView.getQueueSize()); 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 // verify DQL
MessageConsumer dlqConsumer = createDlqConsumer(connection); MessageConsumer dlqConsumer = createDlqConsumer(connection);
int count = 0; int count = 0;