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

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


The following commit(s) were added to refs/heads/camel-4.10.x by this push:
     new b17b2aa67a7 camel-jbang - Fix show-exchange-variables=false in 
debub/trace command.
b17b2aa67a7 is described below

commit b17b2aa67a7fc911a9a5571742992bdd19a11ae3
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Tue Apr 15 18:39:54 2025 +0200

    camel-jbang - Fix show-exchange-variables=false in debub/trace command.
---
 .../java/org/apache/camel/dsl/jbang/core/commands/Debug.java  | 11 +++++++----
 .../dsl/jbang/core/commands/action/CamelTraceAction.java      |  3 +++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Debug.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Debug.java
index 3609862c686..5f9edb0b773 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Debug.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Debug.java
@@ -88,19 +88,19 @@ public class Debug extends Run {
     boolean source;
 
     @CommandLine.Option(names = { "--show-exchange-properties" }, defaultValue 
= "false",
-                        description = "Show exchange properties in traced 
messages")
+                        description = "Show exchange properties in debug 
messages")
     boolean showExchangeProperties;
 
     @CommandLine.Option(names = { "--show-exchange-variables" }, defaultValue 
= "true",
-                        description = "Show exchange variables in traced 
messages")
+                        description = "Show exchange variables in debug 
messages")
     boolean showExchangeVariables = true;
 
     @CommandLine.Option(names = { "--show-headers" }, defaultValue = "true",
-                        description = "Show message headers in traced 
messages")
+                        description = "Show message headers in debug messages")
     boolean showHeaders = true;
 
     @CommandLine.Option(names = { "--show-body" }, defaultValue = "true",
-                        description = "Show message body in traced messages")
+                        description = "Show message body in debug messages")
     boolean showBody = true;
 
     @CommandLine.Option(names = { "--show-exception" }, defaultValue = "true",
@@ -401,6 +401,9 @@ public class Debug extends Run {
                         // we should exchangeId/pattern elsewhere
                         row.message.remove("exchangeId");
                         row.message.remove("exchangePattern");
+                        if (!showExchangeVariables) {
+                            row.message.remove("exchangeVariables");
+                        }
                         if (!showExchangeProperties) {
                             row.message.remove("exchangeProperties");
                         }
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelTraceAction.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelTraceAction.java
index 859efc1ce49..c50c2b8f9f9 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelTraceAction.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelTraceAction.java
@@ -608,6 +608,9 @@ public class CamelTraceAction extends ActionBaseCommand {
                     // we should exchangeId/pattern elsewhere
                     row.message.remove("exchangeId");
                     row.message.remove("exchangePattern");
+                    if (!showExchangeVariables) {
+                        row.message.remove("exchangeVariables");
+                    }
                     if (!showExchangeProperties) {
                         row.message.remove("exchangeProperties");
                     }

Reply via email to