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

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

commit 8165da674a40b0a28b1199fab59c110df02a80a3
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sun May 26 11:29:43 2024 +0200

    CAMEL-20798: Add RemoteAddress to endpoints so they can tell the 
url/hostname etc for the system it connects. This is needed for better 
monitoring, tracing and management. Add this information into camel-tracer as 
tags.
---
 .../jbang/core/commands/process/ListAddress.java   | 25 +++++++++++-----------
 .../jbang/core/commands/process/ListConsumer.java  |  2 ++
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListAddress.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListAddress.java
index 446de7b95f7..0058e83e297 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListAddress.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListAddress.java
@@ -29,7 +29,6 @@ import 
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
 import org.apache.camel.dsl.jbang.core.common.PidNameAgeCompletionCandidates;
 import org.apache.camel.dsl.jbang.core.common.ProcessHelper;
 import org.apache.camel.support.PatternHelper;
-import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.TimeUtils;
 import org.apache.camel.util.json.JsonArray;
 import org.apache.camel.util.json.JsonObject;
@@ -42,26 +41,28 @@ public class ListAddress extends ProcessWatchCommand {
     @CommandLine.Parameters(description = "Name or pid of running Camel 
integration", arity = "0..1")
     String name = "*";
 
-    @CommandLine.Option(names = {"--sort"}, completionCandidates = 
PidNameAgeCompletionCandidates.class,
-            description = "Sort by pid, name or total", defaultValue = "pid")
+    @CommandLine.Option(names = { "--sort" }, completionCandidates = 
PidNameAgeCompletionCandidates.class,
+                        description = "Sort by pid, name or total", 
defaultValue = "pid")
     String sort;
 
-    @CommandLine.Option(names = {"--limit"},
-            description = "Filter addresses by limiting to the given number of 
rows")
+    @CommandLine.Option(names = { "--limit" },
+                        description = "Filter addresses by limiting to the 
given number of rows")
     int limit;
 
-    @CommandLine.Option(names = {"--filter"},
-            description = "Filter addresses")
+    @CommandLine.Option(names = { "--filter" },
+                        description = "Filter addresses")
     String filter;
 
-    @CommandLine.Option(names = {"--filter-direction"},
-            description = "Filter by direction (in or out)")
+    @CommandLine.Option(names = { "--filter-direction" },
+                        description = "Filter by direction (in or out)")
     String filterDirection;
 
-    @CommandLine.Option(names = {"--wide-uri"},
-            description = "List endpoint URI in full details")
+    @CommandLine.Option(names = { "--wide-uri" },
+                        description = "List endpoint URI in full details")
     boolean wideUri;
 
+    // TODO: Hosted is on consumer
+
     public ListAddress(CamelJBangMain main) {
         super(main);
     }
@@ -152,7 +153,7 @@ public class ListAddress extends ProcessWatchCommand {
                 new 
Column().header("AGE").headerAlign(HorizontalAlign.CENTER).with(r -> r.age),
                 new Column().header("DIR").with(this::getDirection),
                 new Column().header("TOTAL").with(r -> r.total),
-                new 
Column().header("HOSTED").dataAlign(HorizontalAlign.CENTER).with(this::getHosted),
+                // new 
Column().header("HOSTED").dataAlign(HorizontalAlign.CENTER).with(this::getHosted),
                 new 
Column().header("URI").visible(!wideUri).dataAlign(HorizontalAlign.LEFT)
                         .maxWidth(90, OverflowBehaviour.ELLIPSIS_RIGHT)
                         .with(this::getUri),
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
index ee5224aca8c..f3540e0d359 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
@@ -100,6 +100,7 @@ public class ListConsumer extends ProcessWatchCommand {
                                 row.uri = o.getString("uri");
                                 row.state = o.getString("state");
                                 row.className = o.getString("class");
+                                row.hostedService = 
o.getBooleanOrDefault("hostedService", false);
                                 row.scheduled = o.getBoolean("scheduled");
                                 row.inflight = o.getInteger("inflight");
                                 row.polling = o.getBoolean("polling");
@@ -266,6 +267,7 @@ public class ListConsumer extends ProcessWatchCommand {
         String uri;
         String state;
         String className;
+        boolean hostedService;
         boolean scheduled;
         int inflight;
         Boolean polling;

Reply via email to