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
The following commit(s) were added to refs/heads/main by this push: new f5ea5eeee9b CAMEL-20431: camel-jbang - Backlog debugger in suspend mode via -D should carry over to child process if using --camel-version to run with a different version. f5ea5eeee9b is described below commit f5ea5eeee9b7825350559ab8b6706ff212f731a6 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Feb 21 19:49:12 2024 +0100 CAMEL-20431: camel-jbang - Backlog debugger in suspend mode via -D should carry over to child process if using --camel-version to run with a different version. --- .../main/java/org/apache/camel/dsl/jbang/core/commands/Run.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 da33043fd47..221259ad051 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 @@ -62,6 +62,7 @@ import org.apache.camel.generator.openapi.RestDslGenerator; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.main.KameletMain; import org.apache.camel.main.download.DownloadListener; +import org.apache.camel.spi.BacklogDebugger; import org.apache.camel.support.ResourceHelper; import org.apache.camel.util.AntPathMatcher; import org.apache.camel.util.CamelCaseOrderedProperties; @@ -924,6 +925,12 @@ public class Run extends CamelCommand { if (kameletsVersion != null) { jbangArgs.add("-Dcamel-kamelets.version=" + kameletsVersion); } + // tooling may signal to run JMX debugger in suspended mode via JVM system property + // which we must include in args as well + String debugSuspend = System.getProperty(BacklogDebugger.SUSPEND_MODE_SYSTEM_PROP_NAME); + if (debugSuspend != null) { + jbangArgs.add("-D" + BacklogDebugger.SUSPEND_MODE_SYSTEM_PROP_NAME + "=" + debugSuspend); + } if (isDebugMode()) { jbangArgs.add("--debug=" + jvmDebugPort); // jbang --debug=port cmds.removeIf(arg -> arg.startsWith("--jvm-debug"));