From 35e0ab63cd216a6684765b6379c837a64971353d Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Wed, 15 Apr 2020 14:33:37 -0500 Subject: [PATCH] ARTEMIS-2715 master broker created w/--replicated should use vote-on-replication-failure=true --- .../org/apache/activemq/artemis/cli/commands/Create.java | 5 +++-- .../cli/commands/etc/replicated-master-settings.txt | 8 ++++++++ ...licated-settings.txt => replicated-slave-settings.txt} | 2 +- .../org/apache/activemq/cli/test/StreamClassPathTest.java | 4 ++-- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-master-settings.txt rename artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/{replicated-settings.txt => replicated-slave-settings.txt} (73%) 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 6e05e9bb30..2c56c35fa1 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 @@ -91,7 +91,8 @@ public class Create extends InputAbstract { private static final String ETC_LOGIN_CONFIG = "login.config"; private static final String ETC_LOGIN_CONFIG_WITH_GUEST = "etc/login-with-guest.config"; private static final String ETC_LOGIN_CONFIG_WITHOUT_GUEST = "etc/login-without-guest.config"; - public static final String ETC_REPLICATED_SETTINGS_TXT = "etc/replicated-settings.txt"; + public static final String ETC_REPLICATED_MASTER_SETTINGS_TXT = "etc/replicated-master-settings.txt"; + public static final String ETC_REPLICATED_SLAVE_SETTINGS_TXT = "etc/replicated-slave-settings.txt"; public static final String ETC_SHARED_STORE_SETTINGS_TXT = "etc/shared-store-settings.txt"; public static final String ETC_CLUSTER_SECURITY_SETTINGS_TXT = "etc/cluster-security-settings.txt"; public static final String ETC_CLUSTER_SETTINGS_TXT = "etc/cluster-settings.txt"; @@ -590,7 +591,7 @@ public class Create extends InputAbstract { if (replicated) { clustered = true; - filters.put("${replicated.settings}", readTextFile(ETC_REPLICATED_SETTINGS_TXT, filters)); + filters.put("${replicated.settings}", readTextFile(isSlave() ? ETC_REPLICATED_SLAVE_SETTINGS_TXT : ETC_REPLICATED_MASTER_SETTINGS_TXT, filters)); } else { filters.put("${replicated.settings}", ""); } diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-master-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-master-settings.txt new file mode 100644 index 0000000000..295788bbef --- /dev/null +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-master-settings.txt @@ -0,0 +1,8 @@ + + + + + true + + + diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-slave-settings.txt similarity index 73% rename from artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt rename to artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-slave-settings.txt index 17a2bc372c..b97b8376e4 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-slave-settings.txt @@ -1,6 +1,6 @@ - <${master-slave}/> + diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/StreamClassPathTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/StreamClassPathTest.java index a950ac1c64..0aae575014 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/StreamClassPathTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/StreamClassPathTest.java @@ -44,8 +44,8 @@ public class StreamClassPathTest { testStream(Create.class, "etc/" + Create.ETC_BROKER_XML); testStream(Create.class, "etc/" + Create.ETC_ARTEMIS_ROLES_PROPERTIES); testStream(Create.class, "etc/" + Create.ETC_ARTEMIS_USERS_PROPERTIES); - testStream(Create.class, Create.ETC_REPLICATED_SETTINGS_TXT); - testStream(Create.class, Create.ETC_REPLICATED_SETTINGS_TXT); + testStream(Create.class, Create.ETC_REPLICATED_MASTER_SETTINGS_TXT); + testStream(Create.class, Create.ETC_REPLICATED_SLAVE_SETTINGS_TXT); testStream(Create.class, Create.ETC_SHARED_STORE_SETTINGS_TXT); testStream(Create.class, Create.ETC_CLUSTER_SECURITY_SETTINGS_TXT); testStream(Create.class, Create.ETC_CLUSTER_SETTINGS_TXT);