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 fad9760a9ff CAMEL-20078: camel-jbang - Debug command fad9760a9ff is described below commit fad9760a9ffe0fd521a793e665c7d2c1894f5976 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sat Nov 4 11:05:59 2023 +0100 CAMEL-20078: camel-jbang - Debug command --- .../DebuggerConfigurationPropertiesConfigurer.java | 6 ++++++ .../camel-main-configuration-metadata.json | 1 + core/camel-main/src/main/docs/main.adoc | 3 ++- .../org/apache/camel/main/BaseMainSupport.java | 1 + .../main/DebuggerConfigurationProperties.java | 24 ++++++++++++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/core/camel-main/src/generated/java/org/apache/camel/main/DebuggerConfigurationPropertiesConfigurer.java b/core/camel-main/src/generated/java/org/apache/camel/main/DebuggerConfigurationPropertiesConfigurer.java index 0bd3c6117c0..811756e0a99 100644 --- a/core/camel-main/src/generated/java/org/apache/camel/main/DebuggerConfigurationPropertiesConfigurer.java +++ b/core/camel-main/src/generated/java/org/apache/camel/main/DebuggerConfigurationPropertiesConfigurer.java @@ -31,6 +31,8 @@ public class DebuggerConfigurationPropertiesConfigurer extends org.apache.camel. case "Breakpoints": target.setBreakpoints(property(camelContext, java.lang.String.class, value)); return true; case "enabled": case "Enabled": target.setEnabled(property(camelContext, boolean.class, value)); return true; + case "fallbacktimeout": + case "FallbackTimeout": target.setFallbackTimeout(property(camelContext, long.class, value)); return true; case "includeexception": case "IncludeException": target.setIncludeException(property(camelContext, boolean.class, value)); return true; case "includeexchangeproperties": @@ -58,6 +60,8 @@ public class DebuggerConfigurationPropertiesConfigurer extends org.apache.camel. case "Breakpoints": return java.lang.String.class; case "enabled": case "Enabled": return boolean.class; + case "fallbacktimeout": + case "FallbackTimeout": return long.class; case "includeexception": case "IncludeException": return boolean.class; case "includeexchangeproperties": @@ -86,6 +90,8 @@ public class DebuggerConfigurationPropertiesConfigurer extends org.apache.camel. case "Breakpoints": return target.getBreakpoints(); case "enabled": case "Enabled": return target.isEnabled(); + case "fallbacktimeout": + case "FallbackTimeout": return target.getFallbackTimeout(); case "includeexception": case "IncludeException": return target.isIncludeException(); case "includeexchangeproperties": diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json index 1be0c4a86b8..50fc11640ed 100644 --- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json +++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json @@ -146,6 +146,7 @@ { "name": "camel.debug.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 131072 }, { "name": "camel.debug.breakpoints", "description": "Allows to pre-configure breakpoints (node ids) to use with debugger on startup. Multiple ids can be separated by comma. Use special value route: to add a breakpoint for the first node for every route, in other words this makes it easy to debug from the beginning of every route without knowing the exact node ids.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.debug.enabled", "description": "Enables Debugger in your Camel application.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.debug.fallbackTimeout", "description": "Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used for waiting for a message to arrive at a given breakpoint.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 300 }, { "name": "camel.debug.includeException", "description": "Trace messages to include exception if the message failed", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true }, { "name": "camel.debug.includeExchangeProperties", "description": "Whether to include the exchange properties in the traced message", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true }, { "name": "camel.debug.loggingLevel", "description": "The debugger logging level to use when logging activity.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "object", "javaType": "org.apache.camel.LoggingLevel", "defaultValue": "INFO", "enum": [ "ERROR", "WARN", "INFO", "DEBUG", "TRACE", "OFF" ] }, diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc index 0674c46534a..a7c11d4c240 100644 --- a/core/camel-main/src/main/docs/main.adoc +++ b/core/camel-main/src/main/docs/main.adoc @@ -173,7 +173,7 @@ The camel.server supports 10 options, which are listed below. === Camel Debugger configurations -The camel.debug supports 10 options, which are listed below. +The camel.debug supports 11 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== @@ -183,6 +183,7 @@ The camel.debug supports 10 options, which are listed below. | *camel.debug.bodyMaxChars* | To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. | 131072 | int | *camel.debug.breakpoints* | Allows to pre-configure breakpoints (node ids) to use with debugger on startup. Multiple ids can be separated by comma. Use special value route: to add a breakpoint for the first node for every route, in other words this makes it easy to debug from the beginning of every route without knowing the exact node ids. | | String | *camel.debug.enabled* | Enables Debugger in your Camel application. | false | boolean +| *camel.debug.fallbackTimeout* | Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used for waiting for a message to arrive at a given breakpoint. | 300 | long | *camel.debug.includeException* | Trace messages to include exception if the message failed | true | boolean | *camel.debug.includeExchange{zwsp}Properties* | Whether to include the exchange properties in the traced message | true | boolean | *camel.debug.loggingLevel* | The debugger logging level to use when logging activity. | INFO | LoggingLevel diff --git a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java index ab4f51231cf..e3fc6bcdead 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java @@ -1504,6 +1504,7 @@ public abstract class BaseMainSupport extends BaseService { debugger.setIncludeException(config.isIncludeException()); debugger.setLoggingLevel(config.getLoggingLevel().name()); debugger.setSuspendMode(config.isWaitForAttach()); + debugger.setFallbackTimeout(config.getFallbackTimeout()); // start debugger after context is started camelContext.addLifecycleStrategy(new LifecycleStrategySupport() { diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java index 48b2629115c..885b11aae7a 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java @@ -49,6 +49,8 @@ public class DebuggerConfigurationProperties implements BootstrapCloseable { private boolean includeExchangeProperties = true; @Metadata(defaultValue = "true") private boolean includeException = true; + @Metadata(label = "advanced", defaultValue = "300") + private long fallbackTimeout = 300; public DebuggerConfigurationProperties(MainConfigurationProperties parent) { this.parent = parent; @@ -180,6 +182,18 @@ public class DebuggerConfigurationProperties implements BootstrapCloseable { this.includeException = includeException; } + public long getFallbackTimeout() { + return fallbackTimeout; + } + + /** + * Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used + * for waiting for a message to arrive at a given breakpoint. + */ + public void setFallbackTimeout(long fallbackTimeout) { + this.fallbackTimeout = fallbackTimeout; + } + /** * Enables Debugger in your Camel application. */ @@ -267,4 +281,14 @@ public class DebuggerConfigurationProperties implements BootstrapCloseable { return (DebuggerConfigurationProperties) this; } + /** + * Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used + * for waiting for a message to arrive at a given breakpoint. + */ + public DebuggerConfigurationProperties withFallbackTimeout(long fallbackTimeout) { + this.fallbackTimeout = fallbackTimeout; + return (DebuggerConfigurationProperties) this; + } + + }