Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: CAMEL-656

...

Code Block
timer:name?options

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

...

Name

...

Default Value

...

Description

name

...

null

...

of the Timer object which is created and shared across endpoints. So if you use the same name for all your timer endpoints then only one Timer object & thread will be used |

Options

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

Name

Default Value

Description

time

 

null

A java.util.Date the first The date/time that the (first) event should be generated .

period

-1 1000

If set to greater than 0, then generate periodic events every period milliseconds

delay

-1 0

The number of milliseconds to wait before the first event is generated. Should not be used in conjunction with the time parameter.

fixedRate

false

Events take place at approximately regular intervals, separated by the specified period .

daemon

true

Should the thread associated with the timer endpoint be run as a daemon .

Exchange Properties

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

...

Name

Type

Description

firedTime

Date

Camel 1.5: the current time when the consumer fired

...

Sample

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

Code Block
java
java
   from("timer://foo?fixedRate=true&delay=0&period=60000").to("bean:myBean?methodName=someMethodName");

...