You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/10/24 08:38:35 UTC

[camel] 02/02: CAMEL-18630: camel-jbang - Add get health command

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 442b1126c35d447ffd1338441e179624bb7424f2
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Oct 24 10:38:00 2022 +0200

    CAMEL-18630: camel-jbang - Add get health command
---
 .../camel/dsl/jbang/core/commands/process/ListHealth.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListHealth.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListHealth.java
index e42979a0569..d5a99651668 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListHealth.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListHealth.java
@@ -41,7 +41,7 @@ public class ListHealth extends ProcessBaseCommand {
     String sort;
 
     @CommandLine.Option(names = { "--level" },
-                        description = "Level of details: full, oneline, or default", defaultValue = "default")
+                        description = "Level of details: full, or default", defaultValue = "default")
     String level;
 
     @CommandLine.Option(names = { "--down" },
@@ -144,6 +144,14 @@ public class ListHealth extends ProcessBaseCommand {
                             if (down && !row.state.equals("DOWN")) {
                                 add = false;
                             }
+                            if (level == null || "default".equals(level)) {
+                                if (row.state.equals("UP") && "camel".equals(row.group)
+                                        && (row.id.startsWith("route:") || row.id.startsWith("consumer:"))) {
+                                    // skip camel/route: camel/consumer: checks when they are UP
+                                    // as they are less relevant and is verbose
+                                    add = false;
+                                }
+                            }
                             if (add) {
                                 rows.add(row);
                             }