io.quarkus.quartz.runtime.QuartzBuildTimeConfig Maven / Gradle / Ivy
Show all versions of quarkus-quartz Show documentation
package io.quarkus.quartz.runtime;
import java.util.Map;
import java.util.Optional;
import io.quarkus.runtime.annotations.ConfigDocMapKey;
import io.quarkus.runtime.annotations.ConfigDocSection;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
public class QuartzBuildTimeConfig {
/**
* Enable cluster mode or not.
*
* If enabled make sure to set the appropriate cluster properties.
*/
@ConfigItem
public boolean clustered;
/**
* The frequency (in milliseconds) at which the scheduler instance checks-in with other instances of the cluster.
*
* Ignored if using a `ram` store i.e {@link StoreType#RAM}.
*/
@ConfigItem(defaultValue = "15000")
public long clusterCheckinInterval;
/**
* The type of store to use.
*
* When using {@link StoreType#JDBC_CMT} or {@link StoreType#JDBC_TX} configuration values make sure that you have the
* datasource configured. See Configuring your datasource for more
* information.
*
* To create Quartz tables, you can perform a schema migration via the Flyway
* extension using a SQL script matching your database picked from Quartz
* repository.
*/
@ConfigItem(defaultValue = "ram")
public StoreType storeType;
/**
* The name of the datasource to use.
*
* Ignored if using a `ram` store i.e {@link StoreType#RAM}.
*
* Optionally needed when using the `jdbc-tx` or `jdbc-cmt` store types.
* If not specified, defaults to using the default datasource.
*/
@ConfigItem(name = "datasource")
public Optional dataSourceName;
/**
* The prefix for quartz job store tables.
*
* Ignored if using a `ram` store i.e {@link StoreType#RAM}
*/
@ConfigItem(defaultValue = "QRTZ_")
public String tablePrefix;
/**
* The SQL string that selects a row in the "LOCKS" table and places a lock on the row.
*
* Ignored if using a `ram` store i.e {@link StoreType#RAM}.
*
* If not set, the default value of Quartz applies, for which the "{0}" is replaced during run-time with the
* `table-prefix`, the "{1}" with the `instance-name`.
*
* An example SQL string `SELECT * FROM {0}LOCKS WHERE SCHED_NAME = {1} AND LOCK_NAME = ? FOR UPDATE`
*/
@ConfigItem
public Optional selectWithLockSql;
/**
* Instructs JDBCJobStore to serialize JobDataMaps in the BLOB column.
*
* Ignored if using a `ram` store i.e {@link StoreType#RAM}.
*
* If this is set to `true`, the JDBCJobStore will store the JobDataMaps in their serialize form in the BLOB Column.
* This is useful when you want to store complex JobData objects other than String.
* This is equivalent of setting `org.quartz.jobStore.useProperties` to `false`.
* NOTE: When this option is set to `true`, all the non-String classes used in JobDataMaps have to be registered
* for serialization when building a native image
*
* If this is set to `false` (the default), the values can be stored as name-value pairs rather than storing more complex
* objects in their serialized form in the BLOB column.
* This can be handy, as you avoid the class versioning issues that can arise from serializing your non-String classes into
* a BLOB.
* This is equivalent of setting `org.quartz.jobStore.useProperties` to `true`.
*/
@ConfigItem(defaultValue = "false")
public Optional serializeJobData;
/**
* Instance ID generators.
*/
@ConfigItem
@ConfigDocMapKey("generator-name")
@ConfigDocSection
public Map instanceIdGenerators;
/**
* Trigger listeners.
*/
@ConfigItem
@ConfigDocMapKey("listener-name")
@ConfigDocSection
public Map triggerListeners;
/**
* Job listeners.
*/
@ConfigItem
@ConfigDocMapKey("listener-name")
@ConfigDocSection
public Map jobListeners;
/**
* Plugins.
*/
@ConfigItem
@ConfigDocMapKey("plugin-name")
@ConfigDocSection
public Map plugins;
}