2 Home
gitea_admin edited this page 2026-03-11 14:42:50 +00:00

Timer

Generate messages in specified intervals using java.util.Timer.

Metadata

Property Value
Scheme timer
Support Level Stable
Labels core,scheduling
Version 4.10.2

Maven Dependency

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-timer</artifactId>
    <version>4.10.2</version>
</dependency>

Endpoint Properties

Name Type Required Default Description
timerName string The name of the timer
delay duration 1000 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 boolean false Events take place at approximately regular intervals, separated by the specified period.
includeMetadata boolean false Whether to include metadata in the exchange such as fired time, timer name, timer count etc.
period duration 1000 Generate periodic events every period. Must be zero or positive value. The default value is 1000.
repeatCount integer 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 boolean false 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 messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exceptionHandler object To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exchangePattern object Sets the exchange pattern when the consumer creates an exchange.
daemon boolean true Specifies whether the thread associated with the timer endpoint runs as a daemon. The default value is true.
pattern string Allows you to specify a custom Date pattern to use for setting the time option using URI syntax.
synchronous boolean false Sets whether synchronous processing should be strictly used
time string 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 object To use a custom Timer
runLoggingLevel object TRACE The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.