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 9f28c66540fab3de1e18fd2af9498fae8703a2b8 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 19:52:19 2026 +0100 CAMEL-23832: camel-timer - improve the component and option descriptions This commit rewrites the texts of 9 endpoint options and 2 headers of timer; the component description and the correct texts (repeatCount, daemon, includeMetadata) stay. The new texts say what a negative delay and a period of 0 do, how fixedRate differs from the default fixed delay, which consumers share a timer, how the time option is parsed, and that runLoggingLevel logs each fire, not a poll. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-timer is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../org/apache/camel/catalog/components/timer.json | 22 ++--- .../org/apache/camel/component/timer/timer.json | 22 ++--- .../camel/component/timer/TimerConstants.java | 7 +- .../camel/component/timer/TimerEndpoint.java | 74 +++++++--------- .../builder/endpoint/StaticEndpointBuilders.java | 8 +- .../endpoint/dsl/TimerEndpointBuilderFactory.java | 98 ++++++++++++++-------- tasks/component-descriptions.md | 2 +- 7 files changed, 129 insertions(+), 104 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/timer.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/timer.json index a33540136825..f6ac97e45cd3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/timer.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/timer.json @@ -30,27 +30,27 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { - "CamelTimerFiredTime": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "Date", "deprecated": false, "autowired": false, "secret": false, "description": "The fired time", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_FIRED_TIME" }, - "CamelMessageTimestamp": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "description": "The timestamp of the message", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_MESSAGE_TIMESTAMP" } + "CamelTimerFiredTime": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "Date", "deprecated": false, "autowired": false, "secret": false, "description": "The time when the timer fired. Set only when the includeMetadata option is enabled.", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_FIRED_TIME" }, + "CamelMessageTimestamp": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "description": "The time when the timer fired, in milliseconds since the epoch. Set only when the includeMetadata option is enabled.", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_MESSAGE_TIMESTAMP" } }, "bodyTypes": { "consumerOut": { "carriers": [ "null" ], "description": "No body: the message only starts the route" } }, "properties": { - "timerName": { "index": 0, "kind": "path", "displayName": "Timer Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the timer" }, - "delay": { "index": 1, "kind": "parameter", "displayName": "Delay", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "The number of milliseconds to wait before the first event is generated. Should not be used in conjunction with the time option. The default value is 1000." }, - "fixedRate": { "index": 2, "kind": "parameter", "displayName": "Fixed Rate", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Events take place at approximately regular intervals, separated by the specified period." }, + "timerName": { "index": 0, "kind": "path", "displayName": "Timer Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the timer. The consumers with the same timer name and the same daemon option share one java.util.Timer, whose thread is named after the timer." }, + "delay": { "index": 1, "kind": "parameter", "displayName": "Delay", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "The time in milliseconds to wait before the first fire. The time option replaces it. A negative value fires the messages one after the other as fast as possible on a thread of its own, without the timer, and ignores the period, t [...] + "fixedRate": { "index": 2, "kind": "parameter", "displayName": "Fixed Rate", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to schedule the fires at a fixed rate instead of with a fixed delay. At a fixed rate each fire is planned from the time of the first fire, so the fires after a late one come in quick succession to catch up. With [...] "includeMetadata": { "index": 3, "kind": "parameter", "displayName": "Include Metadata", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to include metadata in the exchange: the exchange properties CamelTimerCounter (the fire count, 1 on the first fire), CamelTimerName, CamelTimerPeriod, CamelTimerFiredTime and CamelTimerTime (when th [...] - "period": { "index": 4, "kind": "parameter", "displayName": "Period", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "Generate periodic events every period. Must be zero or positive value. The default value is 1000." }, + "period": { "index": 4, "kind": "parameter", "displayName": "Period", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "The time in milliseconds between two fires. A value of 0 or less fires only once, except with fixedRate, which needs a positive value." }, "repeatCount": { "index": 5, "kind": "parameter", "displayName": "Repeat Count", "group": "consumer", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "description": "Specifies a maximum limit for the number of fires. Therefore, if you set it to 1, the timer will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, "bridgeErrorHandler": { "index": 6, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] "exceptionHandler": { "index": 7, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] "exchangePattern": { "index": 8, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "daemon": { "index": 9, "kind": "parameter", "displayName": "Daemon", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Specifies whether the thread associated with the timer endpoint runs as a daemon. The default value is true." }, - "pattern": { "index": 10, "kind": "parameter", "displayName": "Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Allows you to specify a custom Date pattern to use for setting the time option using URI syntax." }, - "synchronous": { "index": 11, "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether synchronous processing should be strictly used" }, - "time": { "index": 12, "kind": "parameter", "displayName": "Time", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.util.Date", "deprecated": false, "autowired": false, "secret": false, "description": "A java.util.Date the first event should be generated. If using the URI, the pattern expected is: yyyy-MM-dd HH:mm:ss or yyyy-MM-dd'T'HH:mm:ss." }, - "timer": { "index": 13, "kind": "parameter", "displayName": "Timer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Timer", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom Timer" }, - "runLoggingLevel": { "index": 14, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the log [...] + "pattern": { "index": 10, "kind": "parameter", "displayName": "Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The java.text.SimpleDateFormat pattern to parse the time option with, instead of the default patterns." }, + "synchronous": { "index": 11, "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the consumer processes each exchange synchronously, so the firing thread waits until the route has completed it. If false, the next fire can start while an asynchronous step of the route still proces [...] + "time": { "index": 12, "kind": "parameter", "displayName": "Time", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.util.Date", "deprecated": false, "autowired": false, "secret": false, "description": "The date and time of the first fire, which replaces the delay option. In a URI the value is parsed in the default time zone of the JVM with the pattern yyyy-MM-dd'T'HH:mm:ss, or yyyy-MM-dd HH:mm:ss if it has no T, unless the pattern optio [...] + "timer": { "index": 13, "kind": "parameter", "displayName": "Timer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Timer", "deprecated": false, "autowired": false, "secret": false, "description": "A custom java.util.Timer to schedule the fires on, instead of the timer that the component shares between the consumers of the same timer name. The daemon option is not used, and Camel does not cancel this timer." }, + "runLoggingLevel": { "index": 14, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The logging level of the log lines that the consumer writes when the timer task of a fire starts and co [...] } } diff --git a/components/camel-timer/src/generated/resources/META-INF/org/apache/camel/component/timer/timer.json b/components/camel-timer/src/generated/resources/META-INF/org/apache/camel/component/timer/timer.json index a33540136825..f6ac97e45cd3 100644 --- a/components/camel-timer/src/generated/resources/META-INF/org/apache/camel/component/timer/timer.json +++ b/components/camel-timer/src/generated/resources/META-INF/org/apache/camel/component/timer/timer.json @@ -30,27 +30,27 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { - "CamelTimerFiredTime": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "Date", "deprecated": false, "autowired": false, "secret": false, "description": "The fired time", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_FIRED_TIME" }, - "CamelMessageTimestamp": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "description": "The timestamp of the message", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_MESSAGE_TIMESTAMP" } + "CamelTimerFiredTime": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "Date", "deprecated": false, "autowired": false, "secret": false, "description": "The time when the timer fired. Set only when the includeMetadata option is enabled.", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_FIRED_TIME" }, + "CamelMessageTimestamp": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "", "required": false, "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "description": "The time when the timer fired, in milliseconds since the epoch. Set only when the includeMetadata option is enabled.", "constantName": "org.apache.camel.component.timer.TimerConstants#HEADER_MESSAGE_TIMESTAMP" } }, "bodyTypes": { "consumerOut": { "carriers": [ "null" ], "description": "No body: the message only starts the route" } }, "properties": { - "timerName": { "index": 0, "kind": "path", "displayName": "Timer Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the timer" }, - "delay": { "index": 1, "kind": "parameter", "displayName": "Delay", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "The number of milliseconds to wait before the first event is generated. Should not be used in conjunction with the time option. The default value is 1000." }, - "fixedRate": { "index": 2, "kind": "parameter", "displayName": "Fixed Rate", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Events take place at approximately regular intervals, separated by the specified period." }, + "timerName": { "index": 0, "kind": "path", "displayName": "Timer Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the timer. The consumers with the same timer name and the same daemon option share one java.util.Timer, whose thread is named after the timer." }, + "delay": { "index": 1, "kind": "parameter", "displayName": "Delay", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "The time in milliseconds to wait before the first fire. The time option replaces it. A negative value fires the messages one after the other as fast as possible on a thread of its own, without the timer, and ignores the period, t [...] + "fixedRate": { "index": 2, "kind": "parameter", "displayName": "Fixed Rate", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to schedule the fires at a fixed rate instead of with a fixed delay. At a fixed rate each fire is planned from the time of the first fire, so the fires after a late one come in quick succession to catch up. With [...] "includeMetadata": { "index": 3, "kind": "parameter", "displayName": "Include Metadata", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to include metadata in the exchange: the exchange properties CamelTimerCounter (the fire count, 1 on the first fire), CamelTimerName, CamelTimerPeriod, CamelTimerFiredTime and CamelTimerTime (when th [...] - "period": { "index": 4, "kind": "parameter", "displayName": "Period", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "Generate periodic events every period. Must be zero or positive value. The default value is 1000." }, + "period": { "index": 4, "kind": "parameter", "displayName": "Period", "group": "consumer", "label": "", "required": false, "type": "duration", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1000", "description": "The time in milliseconds between two fires. A value of 0 or less fires only once, except with fixedRate, which needs a positive value." }, "repeatCount": { "index": 5, "kind": "parameter", "displayName": "Repeat Count", "group": "consumer", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "description": "Specifies a maximum limit for the number of fires. Therefore, if you set it to 1, the timer will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, "bridgeErrorHandler": { "index": 6, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] "exceptionHandler": { "index": 7, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] "exchangePattern": { "index": 8, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "daemon": { "index": 9, "kind": "parameter", "displayName": "Daemon", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Specifies whether the thread associated with the timer endpoint runs as a daemon. The default value is true." }, - "pattern": { "index": 10, "kind": "parameter", "displayName": "Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Allows you to specify a custom Date pattern to use for setting the time option using URI syntax." }, - "synchronous": { "index": 11, "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether synchronous processing should be strictly used" }, - "time": { "index": 12, "kind": "parameter", "displayName": "Time", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.util.Date", "deprecated": false, "autowired": false, "secret": false, "description": "A java.util.Date the first event should be generated. If using the URI, the pattern expected is: yyyy-MM-dd HH:mm:ss or yyyy-MM-dd'T'HH:mm:ss." }, - "timer": { "index": 13, "kind": "parameter", "displayName": "Timer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Timer", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom Timer" }, - "runLoggingLevel": { "index": 14, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the log [...] + "pattern": { "index": 10, "kind": "parameter", "displayName": "Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The java.text.SimpleDateFormat pattern to parse the time option with, instead of the default patterns." }, + "synchronous": { "index": 11, "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the consumer processes each exchange synchronously, so the firing thread waits until the route has completed it. If false, the next fire can start while an asynchronous step of the route still proces [...] + "time": { "index": 12, "kind": "parameter", "displayName": "Time", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.util.Date", "deprecated": false, "autowired": false, "secret": false, "description": "The date and time of the first fire, which replaces the delay option. In a URI the value is parsed in the default time zone of the JVM with the pattern yyyy-MM-dd'T'HH:mm:ss, or yyyy-MM-dd HH:mm:ss if it has no T, unless the pattern optio [...] + "timer": { "index": 13, "kind": "parameter", "displayName": "Timer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Timer", "deprecated": false, "autowired": false, "secret": false, "description": "A custom java.util.Timer to schedule the fires on, instead of the timer that the component shares between the consumers of the same timer name. The daemon option is not used, and Camel does not cancel this timer." }, + "runLoggingLevel": { "index": 14, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "enum", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The logging level of the log lines that the consumer writes when the timer task of a fire starts and co [...] } } diff --git a/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerConstants.java b/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerConstants.java index a89b3a0dd553..e9e87b539403 100644 --- a/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerConstants.java +++ b/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerConstants.java @@ -21,9 +21,12 @@ import org.apache.camel.spi.Metadata; public final class TimerConstants { - @Metadata(description = "The fired time", javaType = "Date") + @Metadata(description = "The time when the timer fired. Set only when the includeMetadata option is enabled.", + javaType = "Date") public static final String HEADER_FIRED_TIME = Exchange.TIMER_FIRED_TIME; - @Metadata(description = "The timestamp of the message", javaType = "long") + @Metadata(description = "The time when the timer fired, in milliseconds since the epoch. Set only when the" + + " includeMetadata option is enabled.", + javaType = "long") public static final String HEADER_MESSAGE_TIMESTAMP = Exchange.MESSAGE_TIMESTAMP; private TimerConstants() { diff --git a/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java b/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java index 8fcb40f7acad..ca7e58d2a777 100644 --- a/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java +++ b/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java @@ -49,30 +49,52 @@ import org.apache.camel.support.DefaultEndpoint; headersClass = TimerConstants.class) @BodyTypes(consumerOut = @BodyType(value = Carrier.NULL, description = "No body: the message only starts the route")) public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersSupport { - @UriPath + @UriPath(description = "The name of the timer. The consumers with the same timer name and the same daemon option share" + + " one java.util.Timer, whose thread is named after the timer.") @Metadata(required = true) private String timerName; - @UriParam(defaultValue = "1000", javaType = "java.time.Duration") + @UriParam(defaultValue = "1000", javaType = "java.time.Duration", + description = "The time in milliseconds between two fires. A value of 0 or less fires only once, except" + + " with fixedRate, which needs a positive value.") private long period = 1000; - @UriParam(defaultValue = "1000", javaType = "java.time.Duration") + @UriParam(defaultValue = "1000", javaType = "java.time.Duration", + description = "The time in milliseconds to wait before the first fire. The time option replaces it. A" + + " negative value fires the messages one after the other as fast as possible on a thread of its" + + " own, without the timer, and ignores the period, time and fixedRate options.") private long delay = 1000; @UriParam private long repeatCount; - @UriParam + @UriParam(description = "Whether to schedule the fires at a fixed rate instead of with a fixed delay. At a fixed rate" + + " each fire is planned from the time of the first fire, so the fires after a late one come in" + + " quick succession to catch up. With a fixed delay each fire is planned one period after the" + + " previous fire started.") private boolean fixedRate; @UriParam private boolean includeMetadata; - @UriParam(defaultValue = "TRACE", label = "consumer,scheduler") + @UriParam(defaultValue = "TRACE", label = "consumer,scheduler", + description = "The logging level of the log lines that the consumer writes when the timer task of a fire" + + " starts and completes. Not used when the delay is negative.") private LoggingLevel runLoggingLevel = LoggingLevel.TRACE; @UriParam(label = "advanced", defaultValue = "true") private boolean daemon = true; - @UriParam(label = "advanced") + @UriParam(label = "advanced", + description = "The date and time of the first fire, which replaces the delay option. In a URI the value is" + + " parsed in the default time zone of the JVM with the pattern yyyy-MM-dd'T'HH:mm:ss, or" + + " yyyy-MM-dd HH:mm:ss if it has no T, unless the pattern option is set.") private Date time; - @UriParam(label = "advanced") + @UriParam(label = "advanced", + description = "The java.text.SimpleDateFormat pattern to parse the time option with, instead of the default" + + " patterns.") private String pattern; - @UriParam(label = "advanced") + @UriParam(label = "advanced", + description = "A custom java.util.Timer to schedule the fires on, instead of the timer that the component" + + " shares between the consumers of the same timer name. The daemon option is not used, and Camel" + + " does not cancel this timer.") private Timer timer; - @UriParam(label = "advanced") + @UriParam(label = "advanced", + description = "Whether the consumer processes each exchange synchronously, so the firing thread waits until the" + + " route has completed it. If false, the next fire can start while an asynchronous step of the" + + " route still processes the previous exchange.") private boolean synchronous; public TimerEndpoint() { @@ -135,9 +157,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return timerName; } - /** - * The name of the timer - */ @ManagedAttribute(description = "Timer Name") public void setTimerName(String timerName) { this.timerName = timerName; @@ -163,12 +182,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return delay; } - /** - * The number of milliseconds to wait before the first event is generated. Should not be used in conjunction with - * the time option. - * <p/> - * The default value is 1000. - */ @ManagedAttribute(description = "Timer Delay") public void setDelay(long delay) { this.delay = delay; @@ -179,9 +192,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return fixedRate; } - /** - * Events take place at approximately regular intervals, separated by the specified period. - */ @ManagedAttribute(description = "Timer FixedRate") public void setFixedRate(boolean fixedRate) { this.fixedRate = fixedRate; @@ -192,10 +202,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return runLoggingLevel; } - /** - * The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level - * for that. - */ @ManagedAttribute(description = "The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.") public void setRunLoggingLevel(LoggingLevel runLoggingLevel) { this.runLoggingLevel = runLoggingLevel; @@ -206,11 +212,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return period; } - /** - * Generate periodic events every period. Must be zero or positive value. - * <p/> - * The default value is 1000. - */ @ManagedAttribute(description = "Timer Period") public void setPeriod(long period) { this.period = period; @@ -234,10 +235,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return time; } - /** - * A java.util.Date the first event should be generated. If using the URI, the pattern expected is: yyyy-MM-dd - * HH:mm:ss or yyyy-MM-dd'T'HH:mm:ss. - */ public void setTime(Date time) { this.time = time; } @@ -246,9 +243,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return pattern; } - /** - * Allows you to specify a custom Date pattern to use for setting the time option using URI syntax. - */ public void setPattern(String pattern) { this.pattern = pattern; } @@ -257,9 +251,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return timer; } - /** - * To use a custom {@link Timer} - */ public void setTimer(Timer timer) { this.timer = timer; } @@ -292,9 +283,6 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS return synchronous; } - /** - * Sets whether synchronous processing should be strictly used - */ public void setSynchronous(boolean synchronous) { this.synchronous = synchronous; } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 0eba83c17404..eb5635126823 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -18263,7 +18263,9 @@ public class StaticEndpointBuilders { * Syntax: <code>timer:timerName</code> * * Path parameter: timerName (required) - * The name of the timer + * The name of the timer. The consumers with the same timer name and the + * same daemon option share one java.util.Timer, whose thread is named after + * the timer. * * @param path timerName * @return the dsl builder @@ -18282,7 +18284,9 @@ public class StaticEndpointBuilders { * Syntax: <code>timer:timerName</code> * * Path parameter: timerName (required) - * The name of the timer + * The name of the timer. The consumers with the same timer name and the + * same daemon option share one java.util.Timer, whose thread is named after + * the timer. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TimerEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TimerEndpointBuilderFactory.java index 67f42f369783..31ed30228398 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TimerEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TimerEndpointBuilderFactory.java @@ -45,9 +45,10 @@ public interface TimerEndpointBuilderFactory { } /** - * The number of milliseconds to wait before the first event is - * generated. Should not be used in conjunction with the time option. - * The default value is 1000. + * The time in milliseconds to wait before the first fire. The time + * option replaces it. A negative value fires the messages one after the + * other as fast as possible on a thread of its own, without the timer, + * and ignores the period, time and fixedRate options. * * The option is a: <code>long</code> type. * @@ -62,9 +63,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * The number of milliseconds to wait before the first event is - * generated. Should not be used in conjunction with the time option. - * The default value is 1000. + * The time in milliseconds to wait before the first fire. The time + * option replaces it. A negative value fires the messages one after the + * other as fast as possible on a thread of its own, without the timer, + * and ignores the period, time and fixedRate options. * * The option will be converted to a <code>long</code> type. * @@ -79,8 +81,11 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Events take place at approximately regular intervals, separated by - * the specified period. + * Whether to schedule the fires at a fixed rate instead of with a fixed + * delay. At a fixed rate each fire is planned from the time of the + * first fire, so the fires after a late one come in quick succession to + * catch up. With a fixed delay each fire is planned one period after + * the previous fire started. * * The option is a: <code>boolean</code> type. * @@ -95,8 +100,11 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Events take place at approximately regular intervals, separated by - * the specified period. + * Whether to schedule the fires at a fixed rate instead of with a fixed + * delay. At a fixed rate each fire is planned from the time of the + * first fire, so the fires after a late one come in quick succession to + * catch up. With a fixed delay each fire is planned one period after + * the previous fire started. * * The option will be converted to a <code>boolean</code> type. * @@ -149,8 +157,8 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Generate periodic events every period. Must be zero or positive - * value. The default value is 1000. + * The time in milliseconds between two fires. A value of 0 or less + * fires only once, except with fixedRate, which needs a positive value. * * The option is a: <code>long</code> type. * @@ -165,8 +173,8 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Generate periodic events every period. Must be zero or positive - * value. The default value is 1000. + * The time in milliseconds between two fires. A value of 0 or less + * fires only once, except with fixedRate, which needs a positive value. * * The option will be converted to a <code>long</code> type. * @@ -215,8 +223,9 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * The consumer logs a start/complete log line when it polls. This - * option allows you to configure the logging level for that. + * The logging level of the log lines that the consumer writes when the + * timer task of a fire starts and completes. Not used when the delay is + * negative. * * The option is a: <code>org.apache.camel.LoggingLevel</code> type. * @@ -231,8 +240,9 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * The consumer logs a start/complete log line when it polls. This - * option allows you to configure the logging level for that. + * The logging level of the log lines that the consumer writes when the + * timer task of a fire starts and completes. Not used when the delay is + * negative. * * The option will be converted to a * <code>org.apache.camel.LoggingLevel</code> type. @@ -409,8 +419,8 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Allows you to specify a custom Date pattern to use for setting the - * time option using URI syntax. + * The java.text.SimpleDateFormat pattern to parse the time option with, + * instead of the default patterns. * * The option is a: <code>java.lang.String</code> type. * @@ -424,7 +434,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Sets whether synchronous processing should be strictly used. + * Whether the consumer processes each exchange synchronously, so the + * firing thread waits until the route has completed it. If false, the + * next fire can start while an asynchronous step of the route still + * processes the previous exchange. * * The option is a: <code>boolean</code> type. * @@ -439,7 +452,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * Sets whether synchronous processing should be strictly used. + * Whether the consumer processes each exchange synchronously, so the + * firing thread waits until the route has completed it. If false, the + * next fire can start while an asynchronous step of the route still + * processes the previous exchange. * * The option will be converted to a <code>boolean</code> type. * @@ -454,9 +470,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * A java.util.Date the first event should be generated. If using the - * URI, the pattern expected is: yyyy-MM-dd HH:mm:ss or - * yyyy-MM-dd'T'HH:mm:ss. + * The date and time of the first fire, which replaces the delay option. + * In a URI the value is parsed in the default time zone of the JVM with + * the pattern yyyy-MM-dd'T'HH:mm:ss, or yyyy-MM-dd HH:mm:ss if it has + * no T, unless the pattern option is set. * * The option is a: <code>java.util.Date</code> type. * @@ -470,9 +487,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * A java.util.Date the first event should be generated. If using the - * URI, the pattern expected is: yyyy-MM-dd HH:mm:ss or - * yyyy-MM-dd'T'HH:mm:ss. + * The date and time of the first fire, which replaces the delay option. + * In a URI the value is parsed in the default time zone of the JVM with + * the pattern yyyy-MM-dd'T'HH:mm:ss, or yyyy-MM-dd HH:mm:ss if it has + * no T, unless the pattern option is set. * * The option will be converted to a <code>java.util.Date</code> type. * @@ -486,7 +504,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * To use a custom Timer. + * A custom java.util.Timer to schedule the fires on, instead of the + * timer that the component shares between the consumers of the same + * timer name. The daemon option is not used, and Camel does not cancel + * this timer. * * The option is a: <code>java.util.Timer</code> type. * @@ -500,7 +521,10 @@ public interface TimerEndpointBuilderFactory { return this; } /** - * To use a custom Timer. + * A custom java.util.Timer to schedule the fires on, instead of the + * timer that the component shares between the consumers of the same + * timer name. The daemon option is not used, and Camel does not cancel + * this timer. * * The option will be converted to a <code>java.util.Timer</code> type. * @@ -540,7 +564,9 @@ public interface TimerEndpointBuilderFactory { * Syntax: <code>timer:timerName</code> * * Path parameter: timerName (required) - * The name of the timer + * The name of the timer. The consumers with the same timer name and the + * same daemon option share one java.util.Timer, whose thread is named + * after the timer. * * @param path timerName * @return the dsl builder @@ -559,7 +585,9 @@ public interface TimerEndpointBuilderFactory { * Syntax: <code>timer:timerName</code> * * Path parameter: timerName (required) - * The name of the timer + * The name of the timer. The consumers with the same timer name and the + * same daemon option share one java.util.Timer, whose thread is named + * after the timer. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -582,7 +610,8 @@ public interface TimerEndpointBuilderFactory { public static final TimerHeaderNameBuilder INSTANCE = new TimerHeaderNameBuilder(); /** - * The fired time. + * The time when the timer fired. Set only when the includeMetadata + * option is enabled. * * The option is a: {@code Date} type. * @@ -594,7 +623,8 @@ public interface TimerEndpointBuilderFactory { return "CamelTimerFiredTime"; } /** - * The timestamp of the message. + * The time when the timer fired, in milliseconds since the epoch. Set + * only when the includeMetadata option is enabled. * * The option is a: {@code long} type. * diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index 0ab736f86443..6190776db1eb 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -370,7 +370,7 @@ or removes its row. | camel-thrift | thrift | | | camel-thymeleaf | thymeleaf | | | camel-tika | tika | | -| camel-timer | timer | | +| camel-timer | timer | yes | | camel-twilio | twilio | | | camel-twitter | twitter-directmessage, twitter-search, twitter-timeline | | | camel-typesafe-ai | typesafe-ai | |
