http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java index 80b8412..9d8c531 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.junit.Before; import org.junit.Test; @@ -52,11 +53,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testBasicRoundRobin() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -83,11 +84,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testBasicNonLoadBalanced() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -117,11 +118,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testRoundRobinForwardWhenNoConsumersTrue() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", true, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", true, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", true, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", true, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.STRICT, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -149,11 +150,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testRoundRobinForwardWhenNoConsumersFalseNoLocalQueue() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -176,11 +177,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testRoundRobinForwardWhenNoConsumersFalse() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -210,11 +211,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testRoundRobinForwardWhenNoConsumersFalseLocalConsumer() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -244,11 +245,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testHopsTooLow() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 3, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 3, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 3, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 3, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 3, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -273,11 +274,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testStartStopMiddleOfChain() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); @@ -341,11 +342,11 @@ public class OneWayChainClusterTest extends ClusterTestBase @Test public void testChainClusterConnections() throws Exception { - setupClusterConnection("cluster0-1", 0, 1, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster1-2", 1, 2, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster2-3", 2, 3, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster3-4", 3, 4, "queues", false, 4, isNetty(), true); - setupClusterConnection("cluster4-X", 4, -1, "queues", false, 4, isNetty(), true); + setupClusterConnection("cluster0-1", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster1-2", 1, 2, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster2-3", 2, 3, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster3-4", 3, 4, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); + setupClusterConnection("cluster4-X", 4, -1, "queues", MessageLoadBalancingType.ON_DEMAND, 4, isNetty(), true); startServers(0, 1, 2, 3, 4); Set<ClusterConnection> connectionSet = getServer(0).getClusterManager().getClusterConnections();
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java index b22bbac..a98f881 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.junit.Before; import org.junit.Test; @@ -37,12 +38,12 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase setupServer(0, isFileStorage(), isNetty()); setupServer(1, isFileStorage(), isNetty()); - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } - private void setupCluster(boolean forward) + private void setupCluster(MessageLoadBalancingType messageLoadBalancingType) { for (ActiveMQServer server : servers) { @@ -52,9 +53,9 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase } } // server #0 is connected to server #1 - setupClusterConnection("cluster1", 0, 1, "queues", forward, 1, 0, 500, isNetty(), true); + setupClusterConnection("cluster1", 0, 1, "queues", messageLoadBalancingType, 1, 0, 500, isNetty(), true); // server #1 is connected to nobody - setupClusterConnection("clusterX", 1, -1, "queues", forward, 1, 0, 500, isNetty(), true); + setupClusterConnection("clusterX", 1, -1, "queues", messageLoadBalancingType, 1, 0, 500, isNetty(), true); } protected boolean isNetty() @@ -831,7 +832,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersFalseLoadBalancedQueues() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(1, 0); setupSessionFactory(0, isNetty(), true); @@ -908,7 +909,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersFalseLoadBalancedQueuesNoLocalQueue() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(1, 0); @@ -941,7 +942,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersTrueLoadBalancedQueues() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(1, 0); setupSessionFactory(0, isNetty(), true); @@ -980,7 +981,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase { servers[0].getConfiguration().getClusterConfigurations().clear(); // server #0 is connected to server #1 - setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true); + setupClusterConnection("cluster1", 0, 1, "queues", MessageLoadBalancingType.STRICT, 1, isNetty(), true); startServers(1, 0); @@ -1020,7 +1021,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase { servers[0].getConfiguration().getClusterConfigurations().clear(); // server #0 is connected to server #1 - setupClusterConnection("cluster1", 0, 1, "queues", true, 1, isNetty(), true); + setupClusterConnection("cluster1", 0, 1, "queues", MessageLoadBalancingType.STRICT, 1, isNetty(), true); startServers(1, 0); @@ -1111,7 +1112,7 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase @Test public void testRoundRobinMultipleQueuesWithConsumersWithFilters() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); startServers(1, 0); @@ -1183,8 +1184,8 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase @Test public void testMultipleClusterConnections() throws Exception { - setupClusterConnection("cluster2", 0, 1, "q2", false, 1, isNetty(), true); - setupClusterConnection("cluster3", 0, 1, "q3", false, 1, isNetty(), true); + setupClusterConnection("cluster2", 0, 1, "q2", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), true); + setupClusterConnection("cluster3", 0, 1, "q3", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), true); startServers(1, 0); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java index d93b673..53f99a2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Test; @@ -52,17 +53,17 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase setupLiveServer(4, isFileStorage(), true, isNetty(), false); setupLiveServer(5, isFileStorage(), true, isNetty(), false); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 3, 4, 5); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 3, 4, 5); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 4, 3, 5); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 4, 3, 5); - setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 5, 3, 4); + setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 5, 3, 4); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 4, 5); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 4, 5); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 3, 5); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 3, 5); - setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 3, 4); + setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 3, 4); startServers(0, 1, 2, 3, 4, 5); @@ -96,9 +97,9 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase setupServer(1, true, isNetty()); setupServer(2, true, isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 2, 0); - setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 2, 0); + setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1); startServers(0, 1, 2); @@ -134,8 +135,8 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase setupServer(0, false, isNetty()); setupServer(1, false, isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0); startServers(0, 1); @@ -182,15 +183,15 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase setupServer(3, true, isNetty()); setupServer(4, true, isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2, 3, 4); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2, 3, 4); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2, 3, 4); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2, 3, 4); - setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1, 3, 4); + setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1, 3, 4); - setupClusterConnection("cluster3", "queues", false, 1, isNetty(), 3, 0, 1, 2, 4); + setupClusterConnection("cluster3", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 3, 0, 1, 2, 4); - setupClusterConnection("cluster4", "queues", false, 1, isNetty(), 4, 0, 1, 2, 3); + setupClusterConnection("cluster4", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 4, 0, 1, 2, 3); startServers(0, 1, 2, 3, 4); @@ -235,9 +236,9 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase setupServer(1, true, isNetty()); setupServer(2, true, isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, 10, 100, isNetty(), 0, 1, 2); - setupClusterConnection("cluster1", "queues", false, 1, 10, 100, isNetty(), 1, 2, 0); - setupClusterConnection("cluster1", "queues", false, 1, 10, 100, isNetty(), 2, 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 10, 100, isNetty(), 0, 1, 2); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 10, 100, isNetty(), 1, 2, 0); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, 10, 100, isNetty(), 2, 0, 1); startServers(0, 1, 2); @@ -311,9 +312,9 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase setupServer(1, true, isNetty()); setupServer(2, true, isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, -1, 1000, isNetty(), 0, 1, 2); - setupClusterConnection("cluster1", "queues", false, 1, -1, 1000, isNetty(), 1, 2, 0); - setupClusterConnection("cluster1", "queues", false, 1, -1, 1000, isNetty(), 2, 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, -1, 1000, isNetty(), 0, 1, 2); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, -1, 1000, isNetty(), 1, 2, 0); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, -1, 1000, isNetty(), 2, 0, 1); startServers(0, 1, 2); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java index 9c749a7..17e8a86 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Before; @@ -1021,7 +1022,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersTrueLoadBalancedQueues() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(); @@ -1075,7 +1076,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersFalseLocalConsumerLoadBalancedQueues() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); startServers(); @@ -1130,7 +1131,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersFalseNonLoadBalancedQueues2() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); startServers(); @@ -1184,7 +1185,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersFalseNonLoadBalancedQueues() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); startServers(); @@ -1238,7 +1239,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testRouteWhenNoConsumersTrueNonLoadBalancedQueues() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(); @@ -1292,7 +1293,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testNoLocalQueueNonLoadBalancedQueues() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(); @@ -1331,7 +1332,7 @@ public class SymmetricClusterTest extends ClusterTestBase @Test public void testNoLocalQueueLoadBalancedQueues() throws Exception { - setupCluster(true); + setupCluster(MessageLoadBalancingType.STRICT); startServers(); @@ -1926,32 +1927,32 @@ public class SymmetricClusterTest extends ClusterTestBase protected void setupCluster(String addr1, String addr2, String addr3, String addr4, String addr5) throws Exception { - setupClusterConnection("cluster0", addr1, true, 1, isNetty(), 0, 1, 2, 3, 4); + setupClusterConnection("cluster0", addr1, MessageLoadBalancingType.STRICT, 1, isNetty(), 0, 1, 2, 3, 4); - setupClusterConnection("cluster1", addr2, true, 1, isNetty(), 1, 0, 2, 3, 4); + setupClusterConnection("cluster1", addr2, MessageLoadBalancingType.STRICT, 1, isNetty(), 1, 0, 2, 3, 4); - setupClusterConnection("cluster2", addr3, true, 1, isNetty(), 2, 0, 1, 3, 4); + setupClusterConnection("cluster2", addr3, MessageLoadBalancingType.STRICT, 1, isNetty(), 2, 0, 1, 3, 4); - setupClusterConnection("cluster3", addr4, true, 1, isNetty(), 3, 0, 1, 2, 4); - setupClusterConnection("cluster4", addr5, true, 1, isNetty(), 4, 0, 1, 2, 3); + setupClusterConnection("cluster3", addr4, MessageLoadBalancingType.STRICT, 1, isNetty(), 3, 0, 1, 2, 4); + setupClusterConnection("cluster4", addr5, MessageLoadBalancingType.STRICT, 1, isNetty(), 4, 0, 1, 2, 3); } protected void setupCluster() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { - setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1, 2, 3, 4); + setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1, 2, 3, 4); - setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0, 2, 3, 4); + setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0, 2, 3, 4); - setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 0, 1, 3, 4); + setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 0, 1, 3, 4); - setupClusterConnection("cluster3", "queues", forwardWhenNoConsumers, 1, isNetty(), 3, 0, 1, 2, 4); + setupClusterConnection("cluster3", "queues", messageLoadBalancingType, 1, isNetty(), 3, 0, 1, 2, 4); - setupClusterConnection("cluster4", "queues", forwardWhenNoConsumers, 1, isNetty(), 4, 0, 1, 2, 3); + setupClusterConnection("cluster4", "queues", messageLoadBalancingType, 1, isNetty(), 4, 0, 1, 2, 3); } protected void setupServers() throws Exception http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java index 209fa4d..9dc3b2f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Test; @@ -441,12 +442,12 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest } @Override - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { // The lives setupClusterConnectionWithBackups("cluster0", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 0, @@ -454,7 +455,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster1", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 1, @@ -462,7 +463,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster2", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 2, @@ -470,7 +471,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster3", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 3, @@ -478,7 +479,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster4", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 4, @@ -488,7 +489,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster0", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 5, @@ -496,7 +497,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster1", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 6, @@ -504,7 +505,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster2", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 7, @@ -512,7 +513,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster3", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 8, @@ -520,7 +521,7 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest setupClusterConnectionWithBackups("cluster4", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 9, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java index da80bfb..c4dad42 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; @@ -36,21 +37,21 @@ public class SymmetricClusterWithDiscoveryTest extends SymmetricClusterTest @Override protected void setupCluster() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } @Override - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { - setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); - setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); - setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); - setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); - setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); } @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java index dda1377..9987192 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.junit.Before; import org.junit.Test; @@ -91,13 +92,13 @@ public class TemporaryQueueClusterTest extends ClusterTestBase protected void setupCluster() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { - setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1); - setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0); + setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1); + setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0); } protected void setupServers() throws Exception http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java index df29352..52fbe31 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Before; import org.junit.Test; @@ -42,8 +43,8 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase protected void setupClusters() { - setupClusterConnection("cluster0", 0, 1, "queues", false, 1, isNetty(), false); - setupClusterConnection("cluster1", 1, 0, "queues", false, 1, isNetty(), false); + setupClusterConnection("cluster0", 0, 1, "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), false); + setupClusterConnection("cluster1", 1, 0, "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), false); } protected boolean isNetty() http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java index 14cd241..024966f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; + public class TwoWayTwoNodeClusterWithDiscoveryTest extends TwoWayTwoNodeClusterTest { @@ -40,8 +42,8 @@ public class TwoWayTwoNodeClusterWithDiscoveryTest extends TwoWayTwoNodeClusterT @Override protected void setupClusters() { - setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", false, 1, isNetty()); - setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", false, 1, isNetty()); + setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty()); + setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty()); } @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java index 1e93e89..3e886e8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.failover; import java.util.HashSet; import org.apache.activemq.artemis.api.core.client.ClientSession; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; @@ -33,7 +34,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase protected static final String QUEUES_TESTADDRESS = "queues.testaddress"; private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected abstract void setupCluster(final boolean forwardWhenNoConsumers) throws Exception; + protected abstract void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception; protected abstract void setupServers() throws Exception; @@ -268,7 +269,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase protected void setupCluster() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java index eec0fbb..9d16b45 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java @@ -17,6 +17,8 @@ package org.apache.activemq.artemis.tests.integration.cluster.failover; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; + public class DiscoveryClusterWithBackupFailoverTest extends ClusterWithBackupFailoverTestBase { @@ -25,19 +27,19 @@ public class DiscoveryClusterWithBackupFailoverTest extends ClusterWithBackupFai protected final int groupPort = getUDPDiscoveryPort(); @Override - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { // The lives - setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); // The backups - setupDiscoveryClusterConnection("cluster0", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster1", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster2", 5, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster0", 3, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster1", 4, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster2", 5, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); } @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java index c737909..7ca26e7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java @@ -26,6 +26,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl; import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration; import org.apache.activemq.artemis.core.config.ha.ReplicatedPolicyConfiguration; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration; import org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; @@ -44,11 +45,11 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase setupLiveServer(1, isFileStorage(), isSharedStore(), isNetty(), false); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 2, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 1); setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0); @@ -143,11 +144,11 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase setupLiveServer(1, isFileStorage(), isSharedStore(), isNetty(), false); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 2, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 1); setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java index 6019a81..e5db567 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage; import org.apache.activemq.artemis.api.core.client.ClientProducer; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; @@ -194,9 +195,9 @@ public class ReplicatedDistributionTest extends ClusterTestBase final String address = ReplicatedDistributionTest.ADDRESS.toString(); // notice the abuse of the method call, '3' is not a backup for '1' - setupClusterConnectionWithBackups("test", address, false, 1, true, 1, new int[]{3}); - setupClusterConnectionWithBackups("test", address, false, 1, true, 3, new int[]{2, 1}); - setupClusterConnectionWithBackups("test", address, false, 1, true, 2, new int[]{3}); + setupClusterConnectionWithBackups("test", address, MessageLoadBalancingType.ON_DEMAND, 1, true, 1, new int[]{3}); + setupClusterConnectionWithBackups("test", address, MessageLoadBalancingType.ON_DEMAND, 1, true, 3, new int[]{2, 1}); + setupClusterConnectionWithBackups("test", address, MessageLoadBalancingType.ON_DEMAND, 1, true, 2, new int[]{3}); AddressSettings as = new AddressSettings().setRedistributionDelay(0); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java index 420823d..5555f7e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java @@ -16,15 +16,17 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.failover; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; + public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailoverTestBase { @Override - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { setupClusterConnectionWithBackups("cluster0", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 0, @@ -32,7 +34,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov setupClusterConnectionWithBackups("cluster1", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 1, @@ -40,7 +42,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov setupClusterConnectionWithBackups("cluster2", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 2, @@ -48,7 +50,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov setupClusterConnectionWithBackups("cluster0", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 3, @@ -56,7 +58,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov setupClusterConnectionWithBackups("cluster1", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 4, @@ -64,7 +66,7 @@ public class StaticClusterWithBackupFailoverTest extends ClusterWithBackupFailov setupClusterConnectionWithBackups("cluster2", "queues", - forwardWhenNoConsumers, + messageLoadBalancingType, 1, isNetty(), 5, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ha/HAAutomaticBackupSharedStore.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ha/HAAutomaticBackupSharedStore.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ha/HAAutomaticBackupSharedStore.java index ceb11a6..6aa9eff 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ha/HAAutomaticBackupSharedStore.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/ha/HAAutomaticBackupSharedStore.java @@ -21,6 +21,7 @@ import org.apache.activemq.artemis.core.config.ha.ColocatedPolicyConfiguration; import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration; import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration; import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.junit.Before; import org.junit.Test; @@ -39,11 +40,11 @@ public class HAAutomaticBackupSharedStore extends ClusterTestBase setUpHAPolicy(1); setUpHAPolicy(2); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1, 2); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0, 2); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2); - setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 0, 1); + setupClusterConnection("cluster2", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1); } @Test http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java index 9522480..c9e23fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.restart; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.junit.Test; import java.util.Collection; @@ -35,9 +36,9 @@ public class ClusterRestartTest extends ClusterTestBase setupServer(0, isFileStorage(), isNetty()); setupServer(1, isFileStorage(), isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0); startServers(0, 1); @@ -100,9 +101,9 @@ public class ClusterRestartTest extends ClusterTestBase setupServer(0, isFileStorage(), isNetty()); setupServer(1, isFileStorage(), isNetty()); - setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1); + setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1); - setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0); + setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0); startServers(0, 1); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyTest.java index 30a1416..1ccec8b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyTest.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.topology; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ServerLocator; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; public class HAClientTopologyTest extends TopologyClusterTestBase @@ -32,16 +33,16 @@ public class HAClientTopologyTest extends TopologyClusterTestBase @Override protected void setupCluster() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { - setupClusterConnection("cluster0", "queues", forwardWhenNoConsumers, 1, isNetty(), 0, 1, 2, 3, 4); - setupClusterConnection("cluster1", "queues", forwardWhenNoConsumers, 1, isNetty(), 1, 0, 2, 3, 4); - setupClusterConnection("cluster2", "queues", forwardWhenNoConsumers, 1, isNetty(), 2, 0, 1, 3, 4); - setupClusterConnection("cluster3", "queues", forwardWhenNoConsumers, 1, isNetty(), 3, 0, 1, 2, 4); - setupClusterConnection("cluster4", "queues", forwardWhenNoConsumers, 1, isNetty(), 4, 0, 1, 2, 3); + setupClusterConnection("cluster0", "queues", messageLoadBalancingType, 1, isNetty(), 0, 1, 2, 3, 4); + setupClusterConnection("cluster1", "queues", messageLoadBalancingType, 1, isNetty(), 1, 0, 2, 3, 4); + setupClusterConnection("cluster2", "queues", messageLoadBalancingType, 1, isNetty(), 2, 0, 1, 3, 4); + setupClusterConnection("cluster3", "queues", messageLoadBalancingType, 1, isNetty(), 3, 0, 1, 2, 4); + setupClusterConnection("cluster4", "queues", messageLoadBalancingType, 1, isNetty(), 4, 0, 1, 2, 3); } @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java index ad87ee1..cef51a8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java @@ -20,6 +20,7 @@ import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration; import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory; import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ServerLocator; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; public class HAClientTopologyWithDiscoveryTest extends TopologyClusterTestBase { @@ -36,16 +37,16 @@ public class HAClientTopologyWithDiscoveryTest extends TopologyClusterTestBase @Override protected void setupCluster() throws Exception { - setupCluster(false); + setupCluster(MessageLoadBalancingType.ON_DEMAND); } - protected void setupCluster(final boolean forwardWhenNoConsumers) throws Exception + protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingType) throws Exception { - setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); - setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty()); + setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster3", 3, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); + setupDiscoveryClusterConnection("cluster4", 4, "dg1", "queues", messageLoadBalancingType, 1, isNetty()); } @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java index 29f419a..3e1c53d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Test; @@ -129,6 +130,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase .setConnectorName("local-cc1") .setRetryInterval(250) .setConfirmationWindowSize(1024) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(connectTo); ArrayList<String> connectTo2 = new ArrayList<String>(); @@ -140,6 +142,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase .setConnectorName("local-cc2") .setRetryInterval(250) .setConfirmationWindowSize(1024) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(connectTo2); // Server1 with two acceptors, each acceptor on a different cluster connection @@ -186,6 +189,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase .setConnectorName("local-cc1") .setRetryInterval(250) .setConfirmationWindowSize(1024) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(connectTo); List<String> connectTo2 = new ArrayList<String>(); @@ -197,6 +201,7 @@ public class IsolatedTopologyTest extends ActiveMQTestBase .setConnectorName("local-cc2") .setRetryInterval(250) .setConfirmationWindowSize(1024) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(connectTo2); // Server2 with two acceptors, each acceptor on a different cluster connection http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java index d2cbe45..701722d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.topology; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.junit.Test; import java.util.ArrayList; @@ -82,6 +83,7 @@ public class NonHATopologyTest extends ActiveMQTestBase .setConnectorName("netty") .setRetryInterval(1000) .setConfirmationWindowSize(1000) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(list) .setAllowDirectConnectionsOnly(true)); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java index bf119a8..6b3605e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.activemq.artemis.tests.integration.cluster.util; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration; import org.apache.activemq.artemis.core.config.ha.ReplicatedPolicyConfiguration; @@ -221,6 +222,7 @@ public class MultiServerTestBase extends ActiveMQTestBase .setConnectorName("thisConnector") .setRetryInterval(100) .setConfirmationWindowSize(1024) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(targetServersOnConnection); configuration.getClusterConfigurations().add(clusterConf); @@ -278,6 +280,7 @@ public class MultiServerTestBase extends ActiveMQTestBase .setConnectorName("thisConnector") .setRetryInterval(100) .setConfirmationWindowSize(1024) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(targetServersOnConnection); configuration.getClusterConfigurations().add(clusterConf); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java index d8a27c3..85a0d12 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControl2Test.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.activemq.artemis.tests.integration.management; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Before; import org.junit.After; @@ -144,7 +145,7 @@ public class ClusterConnectionControl2Test extends ManagementTestBase .setConnectorName("netty") .setRetryInterval(1000) .setDuplicateDetection(false) - .setForwardWhenNoConsumers(false) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setMaxHops(1) .setConfirmationWindowSize(1024) .setDiscoveryGroupName(discoveryName); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlTest.java index e3e3daa..bb0fc7b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlTest.java @@ -15,6 +15,7 @@ * limitations under the License. */ package org.apache.activemq.artemis.tests.integration.management; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.junit.Before; import org.junit.After; import org.junit.Test; @@ -83,8 +84,8 @@ public class ClusterConnectionControlTest extends ManagementTestBase Assert.assertEquals(clusterConnectionConfig1.getRetryInterval(), clusterConnectionControl.getRetryInterval()); Assert.assertEquals(clusterConnectionConfig1.isDuplicateDetection(), clusterConnectionControl.isDuplicateDetection()); - Assert.assertEquals(clusterConnectionConfig1.isForwardWhenNoConsumers(), - clusterConnectionControl.isForwardWhenNoConsumers()); + Assert.assertEquals(clusterConnectionConfig1.getMessageLoadBalancingType().getType(), + clusterConnectionControl.getMessageLoadBalancingType()); Assert.assertEquals(clusterConnectionConfig1.getMaxHops(), clusterConnectionControl.getMaxHops()); Object[] connectors = clusterConnectionControl.getStaticConnectors(); @@ -117,8 +118,8 @@ public class ClusterConnectionControlTest extends ManagementTestBase Assert.assertEquals(clusterConnectionConfig2.getRetryInterval(), clusterConnectionControl.getRetryInterval()); Assert.assertEquals(clusterConnectionConfig2.isDuplicateDetection(), clusterConnectionControl.isDuplicateDetection()); - Assert.assertEquals(clusterConnectionConfig2.isForwardWhenNoConsumers(), - clusterConnectionControl.isForwardWhenNoConsumers()); + Assert.assertEquals(clusterConnectionConfig2.getMessageLoadBalancingType().getType(), + clusterConnectionControl.getMessageLoadBalancingType()); Assert.assertEquals(clusterConnectionConfig2.getMaxHops(), clusterConnectionControl.getMaxHops()); Object[] connectorPairs = clusterConnectionControl.getStaticConnectors(); @@ -242,9 +243,10 @@ public class ClusterConnectionControlTest extends ManagementTestBase .setConnectorName(connectorConfig.getName()) .setRetryInterval(RandomUtil.randomPositiveLong()) .setDuplicateDetection(RandomUtil.randomBoolean()) - .setForwardWhenNoConsumers(RandomUtil.randomBoolean()) + .setMessageLoadBalancingType(MessageLoadBalancingType.STRICT) .setMaxHops(RandomUtil.randomPositiveInt()) .setConfirmationWindowSize(RandomUtil.randomPositiveInt()) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setStaticConnectors(connectors); clusterConnectionConfig2 = new ClusterConnectionConfiguration() @@ -253,9 +255,10 @@ public class ClusterConnectionControlTest extends ManagementTestBase .setConnectorName(connectorConfig.getName()) .setRetryInterval(RandomUtil.randomPositiveLong()) .setDuplicateDetection(RandomUtil.randomBoolean()) - .setForwardWhenNoConsumers(RandomUtil.randomBoolean()) + .setMessageLoadBalancingType(MessageLoadBalancingType.OFF) .setMaxHops(RandomUtil.randomPositiveInt()) .setConfirmationWindowSize(RandomUtil.randomPositiveInt()) + .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND) .setDiscoveryGroupName(discoveryGroupName); Configuration conf_0 = createBasicConfig() http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java index bc11ac5..9e9742c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ClusterConnectionControlUsingCoreTest.java @@ -98,9 +98,9 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont return (Boolean) proxy.retrieveAttributeValue("duplicateDetection"); } - public boolean isForwardWhenNoConsumers() + public String getMessageLoadBalancingType() { - return (Boolean) proxy.retrieveAttributeValue("forwardWhenNoConsumers"); + return (String) proxy.retrieveAttributeValue("messageLoadBalancingType"); } public String getName() http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java index 55b1f03..3f0b08d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/SpawnedServerSupport.java @@ -34,6 +34,7 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; @@ -117,7 +118,7 @@ public class SpawnedServerSupport .setConnectorName(connectorName) .setRetryInterval(10) .setDuplicateDetection(false) - .setForwardWhenNoConsumers(true) + .setMessageLoadBalancingType(MessageLoadBalancingType.STRICT) .setConfirmationWindowSize(1) .setStaticConnectors(connectorList); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20326d0d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java index 68c2f63..72da63e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java @@ -30,6 +30,7 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMess import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.core.server.Queue; +import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; @@ -58,9 +59,9 @@ public class ScaleDown3NodeTest extends ClusterTestBase scaleDownConfiguration1.setGroupName("bill"); scaleDownConfiguration1.setEnabled(false); - setupClusterConnection("cluster0", "testAddress", false, 1, isNetty(), 0, 1, 2); - setupClusterConnection("cluster0", "testAddress", false, 1, isNetty(), 1, 0, 2); - setupClusterConnection("cluster0", "testAddress", false, 1, isNetty(), 2, 0, 1); + setupClusterConnection("cluster0", "testAddress", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1, 2); + setupClusterConnection("cluster0", "testAddress", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0, 2); + setupClusterConnection("cluster0", "testAddress", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 2, 0, 1); String scaleDownConnector = servers[0].getConfiguration().getClusterConfigurations().get(0).getStaticConnectors().get(0); Assert.assertEquals(61617, servers[0].getConfiguration().getConnectorConfigurations().get(scaleDownConnector).getParams().get(TransportConstants.PORT_PROP_NAME)); scaleDownConfiguration0.getConnectors().add(scaleDownConnector);