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 2023/02/11 14:58:51 UTC

[camel] 01/02: CAMEL-19033: camel-jbang - Enable backlogTracing out of the box with camel run

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 defe2b1c76e45e4184cedb4b17702543a55de691
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 10 13:02:37 2023 +0100

    CAMEL-19033: camel-jbang - Enable backlogTracing out of the box with camel run
---
 .../main/java/org/apache/camel/dsl/jbang/core/commands/Run.java  | 1 +
 .../src/main/java/org/apache/camel/main/KameletMain.java         | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index 2d01a0f5cd5..ac999f2cdce 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -336,6 +336,7 @@ class Run extends CamelCommand {
         writeSetting(main, profileProperties, "camel.jbang.repos", repos);
         writeSetting(main, profileProperties, "camel.jbang.health", health ? "true" : "false");
         writeSetting(main, profileProperties, "camel.jbang.console", console ? "true" : "false");
+        writeSetting(main, profileProperties, "camel.jbang.backlogTracing", "true");
         // the runtime version of Camel is what is loaded via the catalog
         writeSetting(main, profileProperties, "camel.jbang.camel-version", new DefaultCamelCatalog().getCatalogVersion());
         // merge existing dependencies with --deps
diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java
index e3f9aab6974..aa331e16659 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java
@@ -177,8 +177,6 @@ public class KameletMain extends MainCommandLineSupport {
     /**
      * Optionally set the location of Maven settings.xml if it's different than {@code ~/.m2/settings.xml}. If set to
      * {@code false}, no default settings file will be used at all.
-     *
-     * @param mavenSettings
      */
     public void setMavenSettings(String mavenSettings) {
         this.mavenSettings = mavenSettings;
@@ -191,8 +189,6 @@ public class KameletMain extends MainCommandLineSupport {
     /**
      * Optionally set the location of Maven settings-security.xml if it's different than
      * {@code ~/.m2/settings-security.xml}.
-     *
-     * @param mavenSettingsSecurity
      */
     public void setMavenSettingsSecurity(String mavenSettingsSecurity) {
         this.mavenSettingsSecurity = mavenSettingsSecurity;
@@ -397,6 +393,11 @@ public class KameletMain extends MainCommandLineSupport {
         configure().withShutdownLogInflightExchangesOnTimeout(false);
         configure().withShutdownTimeout(10);
 
+        boolean tracing = "true".equals(getInitialProperties().get("camel.jbang.backlogTracing"));
+        if (tracing) {
+            configure().withBacklogTracing(true);
+        }
+
         boolean health = "true".equals(getInitialProperties().get("camel.jbang.health"));
         if (health && port == null) {
             // use default port 8080 if console is enabled