Author: David McGee
Introduction
Quartz is [1] an open source job scheduling library that can be integrated within a Java application. It can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that may execute virtually anything you may program them to do. Quartz is freely usable, licensed under the Apache 2.0 license.
Errigal utilise Quartz for scheduling of jobs across the IDMS platform. This may be open to future improvements!
Configuration
Using the thread_config table of the SnmpManager database, one can specify on which servers running the Quartz a specific job type should run (e.g. apps1 only runs CONFIG_SYNC and apps2 only runs SYNC_SCHEDULER).
thread_config example (“select * from thread_config”):
| id | failover_hostname | hostname | is_active | type | params | application_port |
| 44 | lb1 | lb1 | DISTRIBUTOR | NULL | 8442 | |
| 45 | apps1 | apps1 | HANDLER | NULL | 8442 | |
| 46 | apps2 | apps2 | HANDLER | NULL | 8442 | |
| 49 | apps1 | apps1 | CONFIG_SYNC | NULL | 8442 | |
| 55 | apps2 | apps2 | SYNC_SCHEDULER | NULL | 8442 |
Grails Plugin
The grails quartz plugin [2] adds Quartz job scheduling features to the Grails framework by wrapping the quartz scheduling library in a plugin. This is possible through specifying the appropriate version of the Quartz plugin via an IDMS application's BuildConfig.groovy (Example: compile ':quartz:1.0.1'). Use of the Grails Quartz plugin at Errigal has been a mixed bag. It has both helped and hindered development at times. Some issues have occurred around clustering.
Scheduling a Job
Please find an example from the [3] official plugin documentation:
Scheduling a Cron Job
Please find an example from the [3] official plugin documentation:
Errigal Support - Quartz Issues observed
Self-assessment
Resources