Skip to content

Instantly share code, notes, and snippets.

@robertoschwald
Last active November 15, 2018 11:11
Show Gist options
  • Save robertoschwald/a2ff0fa052fd1550fd9a7994d6cf8120 to your computer and use it in GitHub Desktop.
Save robertoschwald/a2ff0fa052fd1550fd9a7994d6cf8120 to your computer and use it in GitHub Desktop.
Grails 3.x Quartz-Plugin 2.0.0 application.groovy example configuration for clustering support
quartz {
autoStartup = true
jdbcStore = true
waitForJobsToCompleteOnShutdown = true
// Allows monitoring in Java Melody (if you have the java melody plugin installed in your grails app)
exposeSchedulerInRepository = true
scheduler {
instanceName = 'my_quartz'
instanceId = 'AUTO'
skipUpdateCheck = true // get rid of annoying message on startup
}
threadPool.class = 'org.quartz.simpl.SimpleThreadPool'
threadPool {
threadCount = 5 // Quartz max threads (jobs) at the same time
threadPriority = 5 // Thread.MIN_PRIORITY level
}
// handles its own transactions with the database
jobStore.class = 'org.quartz.impl.jdbcjobstore.JobStoreTX'
jobStore {
misfireThreshold = 60000
driverDelegateClass = 'org.quartz.impl.jdbcjobstore.StdJDBCDelegate'
useProperties = false // Properties passed to the job are NOT all String objects
tablePrefix = 'QRTZ_' // Prefix for the Quartz tables in the database
isClustered = true // Tell Quartz it is clustered
clusterCheckinInterval = 5000 // Check in with the cluster every 5000 ms
}
// Detect the jvm shutdown and call shutdown on the scheduler
plugin {
shutdownhook.cleanShutdown = true
shutdownhook.class = 'org.quartz.plugins.management.ShutdownHookPlugin'
}
// Log the history of triggers and jobs
triggerHistory.class = 'org.quartz.plugins.history.LoggingTriggerHistoryPlugin'
jobHistory.class = 'org.quartz.plugins.history.LoggingJobHistoryPlugin'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment