activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: [ARTEMIS-1791] Large message files are not removed after redistribution across a cluster
Date Mon, 09 Apr 2018 15:11:38 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master b05306dc0 -> ce4670f29


[ARTEMIS-1791] Large message files are not removed after redistribution across a cluster

Issue: https://issues.apache.org/jira/browse/ARTEMIS-1791

Adding test


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/c69d6b04
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c69d6b04
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c69d6b04

Branch: refs/heads/master
Commit: c69d6b047665e7a1b1d05727cb00fa384d5cb456
Parents: b05306d
Author: Ingo Weiss <ingo@redhat.com>
Authored: Mon Apr 9 07:46:15 2018 +0100
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Apr 9 11:06:09 2018 -0400

----------------------------------------------------------------------
 .../LargeMessageRedistributionTest.java         | 45 ++++++++++++++++++++
 1 file changed, 45 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c69d6b04/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java
index 7e444a0..cba1b82 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java
@@ -16,11 +16,56 @@
  */
 package org.apache.activemq.artemis.tests.integration.cluster.distribution;
 
+import java.io.File;
+import java.util.Arrays;
+
+import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
+import org.apache.activemq.artemis.junit.Wait;
+import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.junit.Test;
+
 public class LargeMessageRedistributionTest extends MessageRedistributionTest {
 
+   private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
+
    @Override
    public boolean isLargeMessage() {
       return true;
    }
 
+   @Test
+   public void testRedistributionLargeMessageDirCleanup() throws Exception {
+      final long delay = 1000;
+      final int numMessages = 5;
+
+      setRedistributionDelay(delay);
+      setupCluster(MessageLoadBalancingType.ON_DEMAND);
+
+      startServers(0, 1);
+
+      setupSessionFactory(0, isNetty());
+      setupSessionFactory(1, isNetty());
+
+      createQueue(0, "queues.testaddress", "queue0", null, false);
+      createQueue(1, "queues.testaddress", "queue0", null, false);
+
+      waitForBindings(0, "queues.testaddress", 1, 0, true);
+      waitForBindings(1, "queues.testaddress", 1, 0, true);
+
+      waitForBindings(0, "queues.testaddress", 1, 0, false);
+      waitForBindings(1, "queues.testaddress", 1, 0, false);
+
+      send(0, "queues.testaddress", numMessages, false, null);
+      addConsumer(0, 0, "queue0", null);
+
+      verifyReceiveAll(numMessages, 0);
+      removeConsumer(0);
+
+      addConsumer(1, 1, "queue0", null);
+      verifyReceiveAll(numMessages, 1);
+      removeConsumer(1);
+
+      Wait.assertEquals(0, () -> getServer(0).getConfiguration().getLargeMessagesLocation().listFiles().length);
+      Wait.assertEquals(numMessages, () -> getServer(1).getConfiguration().getLargeMessagesLocation().listFiles().length);
+   }
 }


Mime
View raw message