From 15b5616f0ab300d26544b9a915df47d240d80137 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Fri, 15 May 2020 09:42:28 -0400 Subject: [PATCH] ARTEMIS-2739 Adding Input for queue name --- .../activemq/artemis/cli/commands/check/CheckAbstract.java | 2 +- .../activemq/artemis/cli/commands/check/QueueCheck.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/CheckAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/CheckAbstract.java index c66fe213af..ff1057522d 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/CheckAbstract.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/CheckAbstract.java @@ -36,7 +36,7 @@ import org.apache.commons.lang3.time.StopWatch; public abstract class CheckAbstract extends AbstractAction { @Option(name = "--name", description = "Name of the target to check") - private String name; + protected String name; @Option(name = "--timeout", description = "Time to wait for the check execution, in milliseconds") private int timeout = 30000; diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/QueueCheck.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/QueueCheck.java index 0842fccf78..45ddc3e048 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/QueueCheck.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/check/QueueCheck.java @@ -82,6 +82,10 @@ public class QueueCheck extends CheckAbstract { protected CheckTask[] getCheckTasks() { ArrayList checkTasks = new ArrayList<>(); + if (getName() == null) { + name = input("--name", "Name is a mandatory property for Queue check", null); + } + if (getName() == null) { throw new IllegalArgumentException("The name of the queue is required"); }