Timer Component

The timer: component provides timed events to Bean component. You can only consume events from this endpoint. It produces BeanExchanges that send a Runnable.run() method invocation.

URI format

timer:name?options

Where options is a query string that can specify any of the following parameters:

NameDefault ValueDescription
time The date/time that the (first) event should be generated.
period-1If set to greater than 0, then generate periodic events every period milliseconds
delay-1The number of milliseconds to wait before the first event is generated. Should not be used in conjunction with the time parameter.
fixedRatefalseEvents take place at approximately regular intervals, separated by the specified period.
daemontrueShould the thread associated with the timer endpoint be run as a daemon.

Using

To setup a route that generates an event every 500 seconds:

from("timer://foo?fixedRate=true&delay=0&period=500").to("pojo:bar");

Note that the "bar" pojo registered should implement Runnable.

See Also