Repository navigation
Import grails-quartz - #16185
Import grails-quartz#16185
Conversation
The encrypted variables were encrypted for the repo at https://github.com/grails3-plugins/quartz and will not be valid for the repo currently at https://github.com/grails-plugins/grails-quartz.
…of inferring it from the directory name
Made QuartzJob trait GrailsApplicationAware
# Conflicts: # build.gradle
…sabled, extra check on SessionBinderListener that jdbcStore is turned on.
SchedulerFactoryBean and AdaptableJobFactory come from spring-context-support, which the plugin creates unconditionally, but it was not declared. It is also not reliably inherited from the rest of the stack -- grails-gsp excludes it from its transitive graph -- so an application depending only on this plugin failed to start with a NoClassDefFoundError.
Documents Spring's @scheduled support and its lack of cluster awareness, introduces Quartz as the clustered alternative, and covers Quartz clustering requirements and pitfalls in full.
Restructures the guide so Background Jobs is the entry point, with Basic Scheduling (Spring @scheduled) as the recommended default and Clustered Scheduling (Quartz) presented as the answer to problems Spring's scheduler cannot solve -- principally multi-instance deployments.
Clustering is one capability of the Quartz plugin, not what adding it gives you. Renames the section accordingly and states explicitly, in the chapter intro and on the section landing page, that Quartz defaults to an in-memory job store and must be configured before it is cluster-safe.
45cd632 to
8750284
Compare
|
The commits appear to be here now so this should be ready to review once tests pass. |
|
FYI: Given that we voted already to merge this, I intend to merge by Sunday so it can be in the latest 7.x releases. @matrei @jamesfredley please let me know if you disagree with this approach. |
sbglasius
left a comment
There was a problem hiding this comment.
I know cleaning up was not part of the merge, but QuartzGrailsPlugin property access could really use some love.
| boolean hasHibernate = hasHibernate(manager) | ||
| def hasJdbcStore = properties['org.quartz.jdbcStore']?.toBoolean() | ||
| if (hasJdbcStore == null) { | ||
| hasJdbcStore = true |
There was a problem hiding this comment.
The jdbcStore fallbacks default to true when unset (?.toBoolean() yields null, then the guard assigns true) in doWithSpring, configureScheduler and scheduleJob, contradicting the documented default of false.
An app that overrides the quartz config block without a jdbcStore key (so plugin.yml's false is not in effect) gets a JDBC job store wired to the dataSource and transactionManager beans, and startup fails against a database with no QRTZ_* tables.
| } | ||
|
|
||
| void onChange(Map<String, Object> event) { | ||
| def pluginEnabled = properties['org.quartz.pluginEnabled']?.toBoolean() |
There was a problem hiding this comment.
Missing loading properties?
Properties properties = loadQuartzProperties()
| def pluginEnabled = properties['org.quartz.pluginEnabled']?.toBoolean() | ||
| if (pluginEnabled == null) { | ||
| pluginEnabled = true | ||
| } |
There was a problem hiding this comment.
Used several places, perhaps a method
boolean getPluginEnabled() {
grailsApplication.config.getProperty('quartz.pluginEnabled', Boolean, true)
}
| def hasJdbcStore = properties['org.quartz.jdbcStore']?.toBoolean() | ||
| if (hasJdbcStore == null) { | ||
| hasJdbcStore = true | ||
| } |
There was a problem hiding this comment.
use properties.getProperty('org.quartz.jdbcStor', true).toBoolean() for default value
|
@sbglasius based on your feedback, I addressed the plugin descriptor & other issues. To be consistent, and because we've previously voted on listing author/developers, I've gone ahead and cleaned up a wider set of plugins to be consistent across all of the ones in grails-core |
✅ All tests passed ✅🏷️ Commit: 5758fc0 Learn more about TestLens at testlens.app/docs. |
Per vote [1], this merges grails-quartz into grails-core. I also have fixed some vulnerabilities as part of this merge since I had to scan the repo to merge.