Quartz
Generate messages on a schedule using the cron and simple triggers of the Quartz Scheduler.
What’s inside
-
Quartz component, URI syntax:
quartz:groupName/triggerName
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-quartz-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 13 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.quartz.auto-start-scheduler | Whether the component starts the Quartz scheduler once the CamelContext has started (and when a route is added later), unless the scheduler is already running. With false, the scheduler stays in standby mode, and no trigger fires, until it is started in another way, such as with the Quartz API or JMX. | true | Boolean |
camel.component.quartz.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.quartz.bridge-error-handler | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean |
camel.component.quartz.enable-jmx | Whether to register the Quartz scheduler in JMX, so it can be managed from JMX: the component sets the Quartz property org.quartz.scheduler.jmx.export to true, unless the scheduler properties set it already. Only used for the scheduler that the component creates from the scheduler properties. | true | Boolean |
camel.component.quartz.enabled | Whether to enable auto configuration of the quartz component. This is enabled by default. | Boolean | |
camel.component.quartz.interrupt-jobs-on-shutdown | Whether to interrupt the running jobs when the component shuts down the scheduler that it created, instead of waiting for them to complete. The component sets the Quartz property org.quartz.scheduler.interruptJobsOnShutdown and shuts the scheduler down without waiting: an interrupted job stops the routing of its exchange and fails it with a RejectedExecutionException. Use with care, as it is often better to let the jobs complete and shut down gracefully, as the scheduler does by default. | false | Boolean |
camel.component.quartz.prefix-instance-name | Whether to add the management name of the CamelContext to the instance name of the Quartz scheduler (the Quartz property org.quartz.scheduler.instanceName), such as DefaultQuartzScheduler-camel-1, so each CamelContext has a scheduler of its own. Quartz returns the scheduler it already has in the JVM for an instance name, so with false, the CamelContexts that use the same scheduler properties share one scheduler. Only used for the scheduler that the component creates from the scheduler properties. | true | Boolean |
camel.component.quartz.prefix-job-name-with-endpoint-id | Whether to prefix the trigger name, which is also the name of the job, with the id of the endpoint and an underscore, such as endpoint3_myTimer. The endpoint id is generated in the order the endpoints are created in the JVM, so it can differ after a restart. Can also be set on the endpoint. | false | Boolean |
camel.component.quartz.properties | The Quartz scheduler properties (the org.quartz. keys, such as org.quartz.threadPool.threadCount) for the scheduler that the component creates. They replace the default file org/quartz/quartz.properties of the Quartz JAR as a whole (they are not merged with it), so they must hold every setting that Quartz needs, such as the thread count of the thread pool. Takes precedence over propertiesRef and propertiesFile. | Map | |
camel.component.quartz.properties-file | The file with the Quartz scheduler properties, used when neither properties nor propertiesRef is set. Loaded from the classpath by default; use the file: prefix for a file on the file system. It replaces the default file org/quartz/quartz.properties as a whole. Without any of these options, the component loads org/quartz/quartz.properties from the Quartz JAR, and not a quartz.properties at the root of the classpath or the file of the org.quartz.properties system property, as Quartz itself does. | String | |
camel.component.quartz.properties-ref | The name of a java.util.Properties or Map in the registry with the Quartz scheduler properties, used when the properties option is not set. It replaces the default file org/quartz/quartz.properties as a whole, like the properties option, and takes precedence over propertiesFile. | String | |
camel.component.quartz.scheduler | The Quartz scheduler to use, instead of the one that the component creates. When not set, the single Scheduler in the registry is used, such as the one of spring-boot-starter-quartz. The component does not configure this scheduler (the options properties, propertiesRef, propertiesFile, schedulerFactory, enableJmx, prefixInstanceName and interruptJobsOnShutdown are not used) and does not shut it down. It starts it once the routes have started, unless autoStartScheduler is false or the scheduler is already running. The option is a org.quartz.Scheduler type. | Scheduler | |
camel.component.quartz.scheduler-factory | The Quartz SchedulerFactory that creates the scheduler, instead of a StdSchedulerFactory configured from the scheduler properties. The options properties, propertiesRef, propertiesFile, enableJmx and prefixInstanceName are then not used. The option is a org.quartz.SchedulerFactory type. | SchedulerFactory |