|factoryClassName||The class name of the scheduler factory. You will usually not change this property.||org.quartz.impl.StdSchedulerFactory||No|
|factoryProperties||a Properties object used to customize the scheduler factory.||No|
|factory||You can give here an instance of org.quartz.SchedulerFactory if you have one.||No|
|scheduler||The scheduler property can be set to an existing scheduler.||No|
|cronExpression||The cron expression to schedule events at specified dates / times.||One of cron or repeatInterval|
|repeatInterval||The number of milliseconds between two events||One of cron or repeatInterval|
|repeatCount||The number of events to be scheduled. This value defaults to -1 which means that the events will be scheduled indefinitely.||-1||No|
|startDelay||The number of milliseconds that will elapse before the first event is fired.||0||No|
|groupName||The group name of the scheduled job||mule||No|
|jobGroupName||The job group name of the scheduled job||mule||No|
Additionally, other properties need to be set depending on the type of Job being used. The following describes the standard Mule Jobs and how to configure them.
Mule provides a number of default Job implementations that help orchestrate scheduled events -
- Mule Receiver Job - An inbound endpoint job that schedules events to a Mule component
- Delegating Job - And outbound endpoint job that will schedule a job that is attached to the Mule Event.
- Mule Client Dispatch Job - An outbound endpoint job that will dispatch the event on a given endpoint URI.
- Mule Client Receiver Job - An outbound endpoint job that will perform a receive on an endpoint and then will dispatch the result over a different endpoint.
The following describes the configuration of each.
This is the Job used when an inbound quartz endpoint is configured on a component. It triggers an event to be received by the component based on the endpoint configuration.
A simple endpoint can be configured this way:
The same endpoint can also be expressed as a simple URI -
The payload can be set on the endpoint using the following mutually exclusive properties -
|payload||The value of this property will be used|
|payloadRef||A reference name to an object in a container context such as Jndi, Spring or Classloader container.|
If neither of these properties are set an org.mule.providers.NullPayload will be used.
Extracts the Job object to invoke Mule Event that was dispatched to the quartz endpoint. The job can either be set as a property on
the event (this property can be a container reference or the actual job object) or the payload
of the event can be the Job, in which case when the job is fired the resulting event will have a org.mule.providers.NullPayload payload.
The following properties can be set on the MuleEvent before the event is dispatched to quartz -
|jobObject||An instance of the Job to be invoked.|
|jobRef||A reference name to a Job object in a container context such as Jndi, Spring or Classloader container.|
If the Job is set as the payload of the event, these properties will be ignored and the DelegatingJob will be used automatically.
To explicitly configure the Delegating Job, you need to configure an outbound endpoint -
Can be used to schedule a one-off or repeated message dispatch to a Mule endpoint. To Configure this Job you add an outbound endpoint with the following configuration -
The additional properties set are -
|jobClass||The job class to schedule for execution.|
|jobDispatchEndpoint||This is a property required by the org.mule.providers.quartz.jobs.MuleClientDispatchJob and specifies where to send the dispatch event|
The event payload dispatched with be the same event that triggered the sheduling of the job. The payload will also be the same for each execution of the job. Usually, this Job will be used for one-off execution, to delay event delivery to a later date/time.
Is similar to the MuleClientDispatchJob but will first perform a receive on an endpoint before doing a dispatch. The dispatch will not happen if the receive yielded null.
The configuration is the same as for MuleClientDispatchJob except there a couple of new parameters -
|jobReceiveEndpoint||The endpoint URI (or endpoint identifier) that will be used to receive the event payload before doing a dispatch.|
|jobReceiveTimeout||The number of milliseconds to wait on the receive before timing out the request and returning null.|
A cron endpoint can be configured this way -
The cronExpression property syntax is detailed here.
Here is an example of using Quartz in conjunction with Groovy (thanks to Glenn Murry!)