Contact Us 1-800-596-4880

Quartz Connector

When scheduling tasks, it’s recommended that you instead resort to the Poll Scope

The Quartz Connector supports the scheduling of programmatic events, both inside and outside your Mule flow. Through a quartz endpoint, you can trigger flows that don’t depend on receiving any external input to execute at scheduled times.

For instance, an inbound Quartz endpoint can trigger inbound events, such as temperature reports from a remote location, at regular intervals.

Outbound Quartz endpoints can delay otherwise imminent events. For example, you can prevent outgoing email from being sent as soon as it has completed processing in your Mule flow. Instead, you can use Quartz to delay sending it until the top of the next hour.

Polling

Note that you also have the option to use a Poll scope at the beginning of a flow, which also supports Cron expressions and watermarks. Read more about the Poll scope.

When running in an environment with multiple workers and nodes, a Quartz scheduler, by default, runs on each node whereas the Poll Scope is "smart" enough to only run on a single node. A Quartz scheduler can be configured to work the same as the Poll Scope, but requires configuration of a JDBC JobStore.

To Install this Connector

  1. In Anypoint Studio, click the Exchange icon in the Studio taskbar.

  2. Click Login in Anypoint Exchange.

  3. Search for the connector and click Install.

  4. Follow the prompts to install the connector.

When Studio has an update, a message displays in the lower right corner, which you can click to install the update.

Configuration

Quartz endpoint configuration consists of two stages:

  1. Decide where you want to place the Quartz endpoint within your Mule flow, then drag it from the Palette to the appropriate place in the sequence of building blocks that make up your Mule flow.

    1. If you place the Quartz endpoint at the beginning of the flow, it acts as an inbound endpoint (such as, message source), controlling the timing of inbound events.

    2. If you place the Quartz building block in the middle or at the end of the flow, it serves as an outbound endpoint, controlling the times at which outbound events take place.

  2. Configure the Quartz endpoint by providing values for the fields on the various tabs on the properties editor, which you open by clicking the Quartz icon on the Message Flow canvas.

General Tab

studio quartz gen
Field Description

Display Name

Defaults to the generic endpoint name, which in this case is Quartz. Change the display name, which must be alpha-numeric, to reflect the endpoint’s specific role, such as, Mail Delivery Scheduler.

Stateful

Determines if the job is persistent. If so, the job detail request persists for each request. More importantly, each job triggered executes sequentially. If the job takes longer than the next trigger, the job waits for the current job to execute.

Job Name

Specify a useful internal name for identifying the job (such as, event) performed by this endpoint, such as Hourly Mail Dispatcher.

Cron Expression

Specify a cron expression for scheduling events, which are also referred to as "jobs". See the Wikipedia Cron for an introduction to cron syntax. This property is required if the Repeat interval property is not specified.

Repeat Interval

Specify the time between jobs. This property is required if a Cron expression is not specified.

Repeat Count

Specify the number of times to repeat the job. If set to -1, the job repeats indefinitely.

Start Delay

Specify the time (in ms) that lapses before the first job is triggered.

Job

Add the associated element that runs the job. The available options are:

  • quartz:custom-job

  • quartz:event-generator-job

  • quartz:endpoint-polling-job

  • quartz:scheduled-dispatch-job

Connector Configuration

Use the dropdown list to select a previously configured connector configuration for this endpoint. If you have not created a connector configuration for this type of endpoint, you can do so from this window by clicking Add. Click Edit to modify a previously created global element.

Advanced Tab

studio quartz adv
Field Description

Address

Enter the address for this endpoint, such as, http://localhost:8081/file.

Response Timeout

Specify how long the endpoint must wait for a response (in ms).

Encoding

Choose from a drop-down list the character set used for message data. (Such as, UTF-8).

Disable Transport Transformer

Check this box if you do not want to use the endpoint’s default response transport.

MIME Type

Select from the drop-down list one of the formats this endpoint supports.

Connector Endpoint

Use the drop-down list to select a previously configured global endpoint template, if any exist. If you have not created a global element for this type of endpoint, you do so by clicking Add and completing the fields on the pane that appears. Click Edit to modify a previously created global element.

Enable default events tracking

Enable default business event tracking for this endpoint.

Transformers Tab

studio quartz trans
Field Description

Request Transformer References

Enter a list of synchronous transformers that applies to the request before it is sent to the transport.

See Also