Repository: activemq-artemis Updated Branches: refs/heads/ARTEMIS-780 c9b557dfd -> f72aec041
Add prefix to clustering snf q Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/f72aec04 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/f72aec04 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/f72aec04 Branch: refs/heads/ARTEMIS-780 Commit: f72aec041b80a6ce25db35dbb429d0ae837d5f49 Parents: b9e5264 Author: Martyn Taylor <[email protected]> Authored: Tue Nov 8 10:21:32 2016 +0000 Committer: Martyn Taylor <[email protected]> Committed: Tue Nov 8 10:21:40 2016 +0000 ---------------------------------------------------------------------- .../artemis/core/server/cluster/impl/ClusterConnectionImpl.java | 2 +- .../activemq/artemis/core/server/impl/ScaleDownHandler.java | 3 ++- .../artemis/tests/integration/server/ScaleDown3NodeTest.java | 4 ++-- .../activemq/artemis/tests/integration/server/ScaleDownTest.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f72aec04/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java index 7d35dde..5ee94f0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java @@ -708,7 +708,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn // New node - create a new flow record - final SimpleString queueName = new SimpleString("sf." + name + "." + nodeID); + final SimpleString queueName = new SimpleString(storeAndForwardPrefix + name + "." + nodeID); Binding queueBinding = postOffice.getBinding(queueName); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f72aec04/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java index 9c1e209..2c28676 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java @@ -128,7 +128,8 @@ public class ScaleDownHandler { } } - if (address.toString().startsWith("sf.")) { + String sfPrefix = ((PostOfficeImpl) postOffice).getServer().getInternalNamingPrefix() + "sf."; + if (address.toString().startsWith(sfPrefix)) { messageCount += scaleDownSNF(address, queues, producer); } else { messageCount += scaleDownRegularMessages(address, queues, session, producer); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f72aec04/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 be91bdd..d13e876 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 @@ -117,7 +117,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase { createQueue(2, addressName, queueName1, null, false, servers[2].getConfiguration().getClusterUser(), servers[2].getConfiguration().getClusterPassword()); // pause the SnF queue so that when the server tries to redistribute a message it won't actually go across the cluster bridge - String snfAddress = "sf.cluster0." + servers[0].getNodeID().toString(); + String snfAddress = servers[0].getInternalNamingPrefix() + "sf.cluster0." + servers[0].getNodeID().toString(); Queue snfQueue = ((LocalQueueBinding) servers[2].getPostOffice().getBinding(SimpleString.toSimpleString(snfAddress))).getQueue(); snfQueue.pause(); @@ -260,7 +260,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase { createQueue(2, addressName, queueName3, null, false, servers[2].getConfiguration().getClusterUser(), servers[2].getConfiguration().getClusterPassword()); // pause the SnF queue so that when the server tries to redistribute a message it won't actually go across the cluster bridge - String snfAddress = "sf.cluster0." + servers[0].getNodeID().toString(); + String snfAddress = servers[0].getInternalNamingPrefix() + "sf.cluster0." + servers[0].getNodeID().toString(); Queue snfQueue = ((LocalQueueBinding) servers[2].getPostOffice().getBinding(SimpleString.toSimpleString(snfAddress))).getQueue(); snfQueue.pause(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f72aec04/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java index d2c6fc2..cba3008 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java @@ -163,7 +163,7 @@ public class ScaleDownTest extends ClusterTestBase { for (Map.Entry<SimpleString, Binding> entry : servers[0].getPostOffice().getAllBindings().entrySet()) { String temp = entry.getValue().getAddress().toString(); - if (temp.startsWith("sf.") && temp.endsWith(servers[1].getNodeID().toString())) { + if (temp.startsWith(servers[1].getInternalNamingPrefix() + "sf.") && temp.endsWith(servers[1].getNodeID().toString())) { // we found the sf queue for the other node // need to pause the sfQueue here ((LocalQueueBinding) entry.getValue()).getQueue().pause();
