1. Home
  2. Integrations
  3. t Quartz

t Quartz

Available triggers

The Quartz component allows you to schedule and trigger events based on cron expressions. It enables you to configure tasks to be triggered at regular times, such as every minute, hour, or day, using standard cron syntax.

TIP

See Cron trigger.

URI Syntax: quartz:groupName/triggerName

Main fields

Path parameters

Name
Description
Default
Type
groupName (consumer)The Quartz group name to use. The combination of group name and trigger name should be unique.CamelString
triggerName (consumer)(required) The Quartz trigger name to use. The combination of group name and trigger name should be unique.—String

Query parameters

Name
Description
Default
Type
cron (consumer)Specifies a cron expression to define when the trigger should fire.—String
triggerParameters (advanced)To configure additional options on the trigger. The timeZone parameter is supported when the cron option is present. Otherwise, the repeatInterval and repeatCount parameters are supported. This is a multi-value option with the prefix: trigger.—Map

Examples

Example 1

The flow uses the Quartz component with a cron expression (59+*+*+*+*+?) that runs every minute at second 59. The trigger is identified by the name quartz-trigger in the URI.

Each time the schedule fires, a "This is a test" message is logged.

Result

Example 2

With Quartz, you can explicitly set the time zone used for scheduling tasks. This configuration is important because the same time configured in a cron expression can represent different moments depending on the considered time zone.

Consider the same instant represented in different locations and the following code snippet:

Location
Time
Brasilia3 p.m
UTC6 p.m
Brussels7 p.m
  • Scheduling without specifying a time zone

When you do not specify a time zone in the Quartz URI, the schedule defaults to UTC:

In this case, the log displays the following message:

Next fire date is 2024-02-28T19:21:00.000+0000

This means Quartz interpreted the cron expression as 19:21 (7:21 p.m) in UTC, since no time zone was specified.

  • Scheduling with a specified time zone

Now, by adding the time zone parameter, for example Europe/Brussels, Quartz interprets the cron expression based on this time zone:

The log now displays:

Next fire date is 2024-02-28T18:21:00.000+0000

If you add the parameter trigger.timeZone=Europe/Brussels, Quartz adjusts the schedule to Brussels time. Thus, the log shows the next trigger at 18:21 UTC (6h21 p.m), which corresponds to 19:21 (7h21) in Brussels time.

IMPORTANT

For the time zone configuration to work correctly in Quartz, the schedule must use the cron option. The trigger.timeZone parameter is only applied when cron is present, ensuring execution occurs at the expected time for the configured time zone.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more