Quartz has been edited by Claus Ibsen (Feb 28, 2009). Content:Quartz ComponentThe quartz: component provides a scheduled delivery of messages using the Quartz scheduler.
URI formatquartz://timerName?parameters quartz://groupName/timerName?parameters quartz://groupName/timerName/cronExpression (@deprecated) quartz://groupName/timerName/?cron=_expression_ (Camel 2.0) quartz://timerName?cron=_expression_ (Camel 2.0)
For example the following routing rule will fire 2 timer events to the endpoint mock:results from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").to("mock:result"); When using a StatefulJob the JobDataMap is re-persisted after every execution of the job, thus preserving state for the next execution. Message HeadersCamel adds the getters from Quartz Execution Context as header values. These headers is added: The fireTime header contains the java.util.Date for when the exchange was fired. Using Cron TriggersAvaiable as of Camel 2.0 For example the following will fire a message at 12pm (noon) every day from("quartz://myGroup/myTimerName?cron=0_0_12_*_*_?").to("activemq:Totally.Rocks");
which is equivalent to using the cron _expression_ 0 0 12 * * ? Or you can use + as space in this complex cron _expression_: from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").to("activemq:Totally.Rocks");
which is equivalent to using the cron _expression_ 0 0/5 12-18 ? * MON-FRI The following table shows the URI character encodings we use to preserve valid URI syntax
Using Cron Triggers in Camel 1.x@deprecated For example the following will fire a message at 12pm (noon) every day from("quartz://myGroup/myTimerName/0/0/12/*/*/$").to("activemq:Totally.Rocks"); which is equivalent to using the cron _expression_ 0 0 12 * * ? The following table shows the URI character encodings we use to preserve valid URI syntax
See Also |
Unsubscribe or edit your notifications preferences