Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can append query options to the URI in the following format, ?option=value&option=value&...

Options

Div
classconfluenceTableSmall

Parameter

Default

Description

cron

None

Specifies a cron expression (not compatible with the trigger.* or job.* options).

trigger.repeatCount

0

SimpleTrigger: How many times should the timer repeat?

trigger.repeatInterval

1000

SimpleTrigger: The amount of time in milliseconds between repeated triggers. Must enable trigger.repeatCount to use the simple trigger using this interval.

job.name

null

Sets the job name.

job.XXX

null

Sets the job option with the XXX setter name.

trigger.XXX

null

Sets the trigger option with the XXX setter name.

stateful

false

Uses a Quartz @PersistJobDataAfterExecution and @DisallowConcurrentExecution instead of the default job.

fireNow

false

If it is true will fire the trigger when the route is start when using SimpleTrigger.

deleteJob

true

If set to true, then the trigger automatically delete when route stop. Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse pre-configured trigger with camel Uri. Just ensure the names match. Notice you cannot have both deleteJob and pauseJob set to true.

pauseJob

false

If set to true, then the trigger automatically pauses when route stop. Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse pre-configured trigger with camel Uri. Just ensure the names match. Notice you cannot have both deleteJob and pauseJob set to true.

durableJob

false

Camel

Wiki Markup
{div:class=confluenceTableSmall} || Parameter || Default || Description || | {{cron}} | _None_ | Specifies a {{cron}} expression (not compatible with the {{trigger.\*}} or {{job.\*}} options). | | {{trigger.repeatCount}} | {{0}} | SimpleTrigger: How many times should the timer repeat? | | {{trigger.repeatInterval}} | {{1000}} | SimpleTrigger: The amount of time in milliseconds between repeated triggers. Must enable {{trigger.repeatCount}} to use the simple trigger using this interval. | | {{job.name}} | {{null}} | Sets the job name. | | {{job._XXX_}} | {{null}} | Sets the job option with the {{_XXX_}} setter name. | | {{trigger._XXX_}} | {{null}} | Sets the trigger option with the {{_XXX_}} setter name. | | {{stateful}} | {{false}} | Uses a Quartz {{@PersistJobDataAfterExecution}} and {{@DisallowConcurrentExecution}} instead of the default job. | | {{fireNow}} | {{false}} | If it is true will fire the trigger when the route is start when using SimpleTrigger.| | {{deleteJob}} | {{true}} | If set to true, then the trigger automatically delete when route stop. Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse pre-configured trigger with camel Uri. Just ensure the names match. Notice you cannot have both deleteJob and pauseJob set to true. | | {{pauseJob}} | {{false}} | If set to true, then the trigger automatically pauses when route stop. Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse pre-configured trigger with camel Uri. Just ensure the names match. Notice you cannot have both deleteJob and pauseJob set to true. | | {{durableJob}} | {{false}} | *Camel

2.12.4/2.13

*

:

Whether

or

not

the

job

should

remain

stored

after

it

is

orphaned

(no

triggers

point

to

it).

| | {{recoverableJob}} | {{false}} | *Camel

recoverableJob

false

Camel 2.12.4/2.13

*

:

Instructs

the

scheduler

whether

or

not

the

job

should

be

re-executed

if

a

'recovery'

or

'fail-over'

situation

is

encountered. | {div}


encountered.

usingFixedCamelContextName

falseCamel 2.15.0: If it is true, JobDataMap uses the CamelContext name directly to reference the camel context, if it is false, JobDataMap uses use the CamelContext management name which could be changed during the deploy time.

customCalendar

NoneCamel 2.17.0: Add a custom calendar to Scheduler and Triggers to avoid specific date range (Holidays for example). The customCalendar type is: org.quartz.Calendar

For example, the following routing rule will fire two timer events to the mock:results endpoint:

Code Block
languagejava
from("quartz2://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result");

...

However the Camel Quartz2 component also allows you to configure properties:

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || Parameter || Default || Type || Description || | {{properties}} | {{null}} | {{Properties}} | You can configure a {{

Parameter

Default

Type

Description

properties

null

Properties

You can configure a

java.util.Properties

}}

instance.

| | {{propertiesFile}} | {{null}} | {{String}} | File name of the properties to load from the classpath | {div}

propertiesFile

null

String

File name of the properties to load from the classpath

To do this you can configure this in Spring XML as follows

...

The Quartz2 component offers an option to let the Quartz scheduler be started delayed, or not auto started at all.

Div
classconfluenceTableSmall

Parameter

Default

Type

Description

startDelayedSeconds

0

int

Seconds to wait before starting the quartz scheduler.

autoStartScheduler

true

boolean

Whether or not the scheduler should be auto started.

Wiki Markup
{div:class=confluenceTableSmall} || Parameter || Default || Type || Description || | {{startDelayedSeconds}} | {{0}} | {{int}} | Seconds to wait before starting the quartz scheduler. | | {{autoStartScheduler}} | {{true}} | {{boolean}} | Whether or not the scheduler should be auto started. | {div}

To do this you can configure this in Spring XML as follows

...

The following table shows the URI character encodings we use to preserve valid URI syntax:

Div
classconfluenceTableSmall

URI Character

Cron character

+

Space

Wiki Markup
{div:class=confluenceTableSmall} ||URI Character||Cron character|| | {{\+}} | _Space_ | {div}

Specifying time zone

The Quartz Scheduler allows you to configure time zone per trigger. For example to use a timezone of your country, then you can do as follows:

...

The following options is supported:

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || Parameter || Default || Type || Description || | {{quartzScheduler}} | {{null}} | {{

Parameter

Default

Type

Description

quartzScheduler

null

org.quartz.Scheduler

}} |

To

use

a

custom

Quartz

scheduler.

If

none

configure

then

the

shared

scheduler

from

the

[]

component

is

used.

| | {{cron}} | {{null}} | {{String}} | *Mandatory*: To define the cron expression for triggering the polls. | | {{triggerId}} | {{null}} | {{String}} | To specify the trigger id. If none provided then an UUID is generated and used. | | {{triggerGroup}} | {{QuartzScheduledPollConsumerScheduler}} | {{String}} | To specify the trigger group. | | {{timeZone}} | {{Default}} | {{TimeZone}} | The time zone to use for the CRON trigger. | {div}

cron

null

String

Mandatory: To define the cron expression for triggering the polls.

triggerId

null

String

To specify the trigger id. If none provided then an UUID is generated and used.

triggerGroup

QuartzScheduledPollConsumerScheduler

String

To specify the trigger group.

timeZone

Default

TimeZone

The time zone to use for the CRON trigger.

Important: Remember configuring these options from the endpoint URIs must be prefixed with scheduler..
For example to configure the trigger id and group:

...