Show Table of Contents
6.2. Setting up Quartz
Before you can configure the database on your application server, you need to prepare the database for Quartz to create Quartz tables, which will hold the timer data, and the Quartz definition file.
Of course, if you are not using Quartz (timers) in your business processes, or if you are not using the Execution Server at all, you can skip this section completely. Please note that if you want to replicate timers in your business process, you need to use the Quartz component.
To set this up, do the following:
- Set up the database. Make sure to use one of the supported non-JTA data source. Note, that since Quartz need a non-JTA data source, you cannot use the Business Central data source. In the example code, PostgreSQL with the user
bpmsand passwordbpmsis used. This database will need to be connected to your application server, so make sure to keep a note on the database information and credentials. - Create Quartz tables on your database to allow timer events synchronization. To do so, use the DDL script for your database, which is available in the extracted supplementary zip archive in QUARTZ_HOME/docs/dbTables.
- Create the Quartz configuration file
quartz-definition.propertiesin$JBOSS_HOME/PROFILE/configuration/directory and define the Quartz properties.Example 6.5. Quartz configuration file for a PostgreSQL database
#============================================================================ # Configure Main Scheduler Properties #============================================================================ org.quartz.scheduler.instanceName = jBPMClusteredScheduler org.quartz.scheduler.instanceId = AUTO #============================================================================ # Configure ThreadPool #============================================================================ org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount = 5 org.quartz.threadPool.threadPriority = 5 #============================================================================ # Configure JobStore #============================================================================ org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreCMT org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate org.quartz.jobStore.useProperties=false org.quartz.jobStore.dataSource=managedDS org.quartz.jobStore.nonManagedTXDataSource=notManagedDS org.quartz.jobStore.tablePrefix=QRTZ_ org.quartz.jobStore.isClustered=true org.quartz.jobStore.clusterCheckinInterval = 20000 #============================================================================ # Configure Datasources #============================================================================ org.quartz.dataSource.managedDS.jndiURL=jboss/datasources/psbpmsDS org.quartz.dataSource.notManagedDS.jndiURL=jboss/datasources/quartzNotManagedDS
Note the configured datasources that will accommodate the two Quartz schemes at the very end of the file.Important
The recommended interval for cluster discovery is 20 seconds and is set in the org.quartz.jobStore.clusterCheckinInterval of thequartz-definition.propertiesfile. Depending on your set up consider the performance impact and modify the setting as necessary.Also note the org.quartz.jobStore.driverDelegateClass property that defines the DB dialect to be used when communicating with the set database (in this example,org.quartz.impl.jdbcjobstore.PostgreSQLDelegate. When using Oracle, useorg.quartz.impl.jdbcjobstore.oracle.OracleDelegate).

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.