Skip to content

Quartz2 & Timer

Quartz scheduler and simple timer integration: events can be scheduled in either CronTab or Simple Timer formats.

The simple timer syntax provides event generation at a fixed interval specified in hours, minutes and/or seconds.

The Quartz2 scheduler provides a much more flexible syntax for event generation; similar to the Unix Cron format.

Examples

The following are examples of a simple five seconds interval event:

from("timer://myTimer?period=5s")
    .to("log://camelLogger?level=INFO")
    .routeId("myRoute")
    .description("Five second timer to INFO log")
from("quartz2://myGroupName/myTimerName?cron=0/5+*+*+*+*+?")
    .to("log://camelLogger?level=INFO")
    .routeId("myRoute")
    .description("Quartz schedule INFO logging at zero and five seconds")