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 101c6abc3f..8c8857c0aa 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 @@ -277,7 +277,7 @@ public class Create extends InputAbstract { @Option(name = "--journal-device-block-size", description = "The block size by the device, default at 4096.") private int journalDeviceBlockSize = 4096; - @Option(name = "--journal-retention-days", description = "If > 0, It will enable journal-retention-directory on the broker.xml allowing replay options. This option will configure retention in days.") + @Option(name = "--journal-retention", description = "If > 0, It will enable journal-retention-directory on the broker.xml allowing replay options. This option will configure retention in days.") private int retentionDays; @Option(name = "--journal-retention-max-bytes", description = "It will be passed as storage-limit on the journal-retention-directory tag") @@ -771,17 +771,20 @@ public class Create extends InputAbstract { boolean allowAnonymous = isAllowAnonymous(); - if (retentionDays == 0) { - retentionDays = inputInteger("--journal-retention-days", "How many days you would like to keep retained in the journal? Use 0 for no retention.", "0"); - } - - String retentionTag = ""; + String retentionTag; if (retentionDays > 0) { if (retentionMaxBytes != null) { retentionTag = "" + data + "/retention"; } else { retentionTag = "" + data + "/retention"; } + } else { + retentionTag = "\n" + + " \n\n"; } filters.put("${journal-retention}", retentionTag); diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml index 18429db277..e51fff2e2a 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml @@ -46,16 +46,6 @@ ${jdbc} ${data.dir}/large-messages - - ${journal-retention} ${fsync} diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java index c6e45f243d..454d5fece2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java @@ -516,6 +516,6 @@ public interface ActiveMQMessageBundle { @Message(id = 229238, value = "No target to redirect the connection") ActiveMQRedirectedException cannotRedirect(); - @Message(id = 229239, value = "There is not retention configured. In order to use the replay method you must specify journal-retention-directory element on the broker.xml") + @Message(id = 229239, value = "There is no retention configured. In order to use the replay method you must specify journal-retention-directory element on the broker.xml") IllegalArgumentException noRetention(); } diff --git a/tests/smoke-tests/pom.xml b/tests/smoke-tests/pom.xml index 5ec27377ba..819d2de55c 100644 --- a/tests/smoke-tests/pom.xml +++ b/tests/smoke-tests/pom.xml @@ -1224,7 +1224,7 @@ --java-options -Djava.rmi.server.hostname=localhost - --journal-retention-days + --journal-retention 1 --queues RetentionTest