// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
= Quartz
:page-aliases: extensions/quartz.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-quartz
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Schedule sending of messages using the Quartz 2.x scheduler.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##

Schedule sending of messages using the Quartz 2.x scheduler.

== What's inside

* xref:{cq-camel-components}::quartz-component.adoc[Quartz component], URI syntax: `quartz:groupName/triggerName`

Please refer to the above link for usage and configuration details.

== Maven coordinates

https://code.quarkus.io/?extension-search=camel-quarkus-quartz[Create a new project with this extension on code.quarkus.io, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-quartz</artifactId>
</dependency>
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

=== Clustering

There are two options how to run Quartz in clustered mode:

==== Quarkus based

This is the preferred option. Follow the https://quarkus.io/guides/quartz[scheduling periodic tasks quartz guide].

- Define database configuration in `application.properties`.
- Use for example `flyway` to create database tables required for `Quartz`.

===== Quartz based with an Agroal datasource

Follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] with different DS configuration:

- Use `quartz.properties` to configure the `JobStore`.
- Define a datasource via quarkus (see the https://quarkus.io/guides/datasource[Quarkus datasource documentation)] and use `CamelQuarkusQuartzConnectionProvider` as the `ConnectionProvider` in `quartz.properties`:

```
...
org.quartz.jobStore.dataSource = myDS

# datasource configuration
org.quartz.dataSource.myDS.connectionProvider.class = org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider
org.quartz.dataSource.myDSB.dataSourceName = ds_name_if_not_set_default_ds_will_be_used
```


- You can use for example `flyway` to create database tables required for `Quartz`.

===== Quartz based

You can follow the http://www.quartz-scheduler.org/documentation/quartz-1.8.6/configuration/ConfigJDBCJobStoreClustering.html#configure-clustering-with-jdbc-jobstore[Configure Clustering with JDBC-JobStore Guide] without any modification:

```
...
org.quartz.jobStore.dataSource = myDS

# datasource configuration
org.quartz.dataSource.myDS.driver = org.postgresql.Driver

# datasource configuration
org.quartz.dataSource.myDS.URL=jdbc:postgresql://localhost:5432/default
org.quartz.dataSource.myDS.user = quarkus
org.quartz.dataSource.myDS.password = quarkus
```


== Camel Quarkus limitations

=== JDBC Job Store

Quartz's property `org.quartz.jobStore.useProperties` is set to `true` and can not be modified. The value is forced by the Quarkus Quartz extension.
See the Quartz documentation for more information about `org.quartz.jobStore.useProperties`.

