From 304e71862f216380fd336aaa5af97b6d294ced0e Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 20 May 2015 20:19:07 -0400 Subject: [PATCH] Fixing cluster-settings I have been playing with settings on the examples and the cluster settings are not really working by default The default cluster-settings is using the wrong acceptor and the lack of max-hops is not making it work on most examples maybe I will add some configuration on the max-hops through the create interface. I will set it as 0 for now at least --- .../activemq/artemis/cli/commands/Create.java | 17 +++++++++++++++-- .../cli/commands/etc/cluster-settings.txt | 4 +++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index ca3602404d..bfffa32849 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -103,6 +103,9 @@ public class Create extends InputAbstract @Option(name = "--clustered", description = "Enable clustering") boolean clustered = false; + @Option(name = "--max-hops", description = "Number of hops on the cluster configuration") + int maxHops = 0; + @Option(name = "--replicated", description = "Enable broker replication") boolean replicated = false; @@ -140,6 +143,16 @@ public class Create extends InputAbstract boolean IS_CYGWIN; + public int getMaxHops() + { + return maxHops; + } + + public void setMaxHops(int maxHops) + { + this.maxHops = maxHops; + } + public boolean isNoWeb() { return noWeb; @@ -434,7 +447,7 @@ public class Create extends InputAbstract filters.put("${hq.port}", String.valueOf(HQ_PORT + portOffset)); filters.put("${http.port}", String.valueOf(HTTP_PORT + portOffset)); filters.put("${data.dir}", data); - + filters.put("${max-hops}", String.valueOf(maxHops)); filters.put("${user}", getUser()); filters.put("${password}", getPassword()); filters.put("${role}", getRole()); @@ -448,7 +461,7 @@ public class Create extends InputAbstract filters.put("${connector-config.settings}", connectorSettings); filters.put("${cluster-security.settings}", readTextFile(ETC_CLUSTER_SECURITY_SETTINGS_TXT)); - filters.put("${cluster.settings}", readTextFile(ETC_CLUSTER_SETTINGS_TXT)); + filters.put("${cluster.settings}", applyFilters(readTextFile(ETC_CLUSTER_SETTINGS_TXT), filters)); filters.put("${cluster-user}", getClusterUser()); filters.put("${cluster-password}", getClusterPassword()); } diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-settings.txt index 18460ed94c..2b9c48eedc 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-settings.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-settings.txt @@ -19,7 +19,9 @@
jms
- activemq + artemis + ${max-hops}
+