You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
The case engine scheduler will share the Quartz scheduler instance with its own scheduler, so if you already configured Quartz for the basic scheduler, you just need to enable the case-engine profile and you can skip the remainder of this guide.
Installation
Steps:
- The scheduler will be automatically available if the
case-engine
profile is added to the list of spring active profiles in thebootstrap.properties
. More information on how to configure the application using Spring Profiles can be found here: External application configuration with Spring Profiles. - Add the
application-case-engine.properties
file in the configuration location if it does not yet exist. This properties file is added in thedirectory when using the Blueriq installer.spring.config.additional-location
- Run the provided scripts for creating the quartz tables in the database: msssql.sql, pgsql.sql or oracle.sql. The scripts are located in the release zip in \Runtime\Java\Webapp\DBScripts\blueriq-case-engine-scheduler-quartz
- Define quartz database connection in the
application-
file.externaldatasources
.properties
Steps 3 and 4 are applicable only if Quartz triggers and jobs are stored in a database instead of in memory.
Configuration
Every Quartz configuration property has to be specified in application-case-engine.properties for the Runtime.
Quartz is configured using a set of properties. Quartz uses a job store in order to persist jobs details, triggers and other job related information. We support two types of job stores:
Memory (default)
Info
This is the default configuration for Java environments.
For more details about in memory job store configuration please visit Config RAM Job Store.
By default memory mode is enabled which should be used only for demos and standalone development. For recommended settings please check the Database section. For memory the following setting should be set in the application-
.case-engine
.properties
spring.quartz.job-store-type = memory
Database
For database mode, which is required for production, specify the following in application-
:case-engine
.properties
spring.quartz.job-store-type=jdbc spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ # Enable the delegate for the specific database #spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.MSSQLDelegate #spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate #spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate # when using a JDBC datasource enable tx #spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX # when using a JNDI datasource enable CMT #spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreCMT
JDBCJobStore’s “table prefix” property is a string equal to the prefix given to Quartz’s tables that were created in your database. You can have multiple sets of Quartz’s tables within the same database if they use different table prefixes.
When changing the org.quartz.jobStore.tablePrefix, please change the SQL create scripts accordingly.
Database
Scripts to create the required database content are provided for the supported databases.
For customers that are upgrading, if the database scheme was already created in a previous version, check to see if there are database upgrade scripts provided for any of the intermediate versions in the Upgrade Instructions.
Configuration
Use the following steps to configure the datasource:
- Install the driver for your database. See Configuring JDBC database drivers for information on how to do this.
- Provide the connection details for the datasource. There are two options for this: using JDBC or JNDI.
Using JDBC datasource : this is configured in the
application-
file. When configuring external datasources, theexternaldatasources
.propertiesexternaldatasources
profile should be enabled.application-externaldatasources.propertiesblueriq.datasource.<datasource-name>.url=<JDBC url> blueriq.datasource.<datasource-name>.username=<username> blueriq.datasource.<datasource-name>.password=<password> blueriq.datasource.<datasource-name>.driverClassName=<driver-class>
Using JNDI datasource : this can be configured in the
application-
file. When configuring JNDI datasources thejndidatasources
.propertiesjndidatasources
profile should be enabled.blueriq.datasource.<datasource-name>.jndiName=<JNDI url>
- Provide the appropriate Hibernate settings in the same properties file as step 2.
blueriq.hibernate.<datasource-name>.dialect=<database-dialect> blueriq.hibernate.<datasource-name>.use_nationalized_character_data=true blueriq.hibernate.<datasource-name>.hbm2ddl.auto=validate # validate is the only supported value here
Example configuration
Below are configuration examples which contain a JDBC url, driver-class and dialect for each supported database.
blueriq.datasource.<datasource-name>.url=jdbc:oracle:thin:@<host>:<port>/<servicename> blueriq.datasource.<datasource-name>.username=<username> blueriq.datasource.<datasource-name>.password=<password> blueriq.datasource.<datasource-name>.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.hibernate.<datasource-name>.dialect=org.hibernate.dialect.OracleDialect blueriq.hibernate.<datasource-name>.hibernate.use_nationalized_character_data=true blueriq.hibernate.<datasource-name>.hbm2ddl.auto=validate
blueriq.datasource.<datasource-name>.url=jdbc:sqlserver://<host>:<port>;databaseName=<database>;trustServerCertificate=true blueriq.datasource.<datasource-name>.username=<username> blueriq.datasource.<datasource-name>.password=<password> blueriq.datasource.<datasource-name>.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver blueriq.hibernate.<datasource-name>.dialect=org.hibernate.dialect.SQLServer2012Dialect blueriq.hibernate.<datasource-name>.hibernate.use_nationalized_character_data=true blueriq.hibernate.<datasource-name>.hbm2ddl.auto=validate
blueriq.datasource.<datasource-name>.url=jdbc:postgresql://<host>:<port>/<database> blueriq.datasource.<datasource-name>.username=<username> blueriq.datasource.<datasource-name>.password=<password> blueriq.datasource.<datasource-name>.driverClassName=org.postgresql.Driver blueriq.hibernate.<datasource-name>.dialect=org.hibernate.dialect.PostgreSQLDialect blueriq.hibernate.<datasource-name>.hibernate.use_nationalized_character_data=true blueriq.hibernate.<datasource-name>.hbm2ddl.auto=validate
The datasource created must be named scheduler-quartz
Thread Pool
When the database is configured, we recommend to also configure the thread pool. Each DCM project gets its own trigger. It is recommended to have a thread per DCM project. For example if you have 3 DCM projects you should set the threadCount to 3.
Please check that the threadCount does not exceed the number of available database connections (or connections in the database connection pool). The quartz documentation suggests the following: provided that the database allows X connections, then the threadCount must be set to X - 3.
Below are the default thread Pool properties:
spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool spring.quartz.properties.org.quartz.threadPool.threadCount=2
For more information and properties related to Quartz ThreadPool, please visit ThreadPool Configuration
Clustering
There are many configuration properties for clustering, see the Quartz documentation. To enable clustering, specify at least these properties:
spring.quartz.properties.org.quartz.jobStore.isClustered=true spring.quartz.properties.org.quartz.scheduler.instanceName=MyClusteredScheduler # Have Quartz generate an instanceId for each node in the cluster spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO
Troubleshooting
For more information on quartz configurations, please visit: Quartz-Scheduler.org.