Name

Timer — generates message exchanges when a timer fires

URI format

The URI format for a Timer endpoint is:

timer:name[?options]

name is the name of the Timer object.

Options

Table 48, “Timer options” lists the options for a Timer endpoint.

Table 48. Timer options

NameDefaultDescription
time Specifies the date when 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.
pattern Allows you to specify a custom date pattern to use for setting the time option using URI syntax.
period1000Specifies the period, in milliseconds, at which events are generated.
delay0Specifies the number of milliseconds to wait before the first event is generated. This option should not be used in conjunction with the time option.
fixedRatefalseSpecifies if events take place at approximately regular intervals separated by the specified period.
daemontrueSpecifies whether or not the thread associated with the timer endpoint runs as a daemon.

Exchange Properties

When the timer is fired, it adds the following information as properties to the Exchange:

NameTypeDescription
org.apache.camel.timer.nameStringThe value of the name option.
org.apache.camel.timer.timeDateThe value of the time option.
org.apache.camel.timer.periodlongThe value of the period option.
org.apache.camel.timer.firedTimeDateThe time when the consumer fired.

Message Headers

When the timer is fired, it adds the following information as headers to the IN message:

NameTypeDescription
firedTimeDateThe time when the consumer fired.

Related topics

Quartz