I'm using spring-boot-starter-quartz in a several environements project.
In local env I'd like to use memory jobstore( spring.quartz.job-store-type=memory
)
In all other env (preprod, prod ...) I'd like to use jdbc jobstore (spring.quartz.job-store-type=jdbc
)
I'd like to put in the default application.properties file all common properties and override only usefulls properties in Local env properties file (application-local.properties)
So typically i will put this in application.properties
spring.quartz.job-store-type=jdbc
spring.quartz.jdbc.initialize-schema=never
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
spring.quartz.properties.org.quartz.jobStore.useProperties=false
spring.quartz.properties.org.quartz.jobStore.tablePrefix=qrtz_
spring.quartz.properties.org.quartz.jobStore.isClustered=false
And in application-local.properties
spring.quartz.jdbc.initialize-schema=always
spring.quartz.job-store-type=MEMORY
Quartz doesn't like this config. I'm facing exception like java.lang.NoSuchMethodException: No setter for property 'tablePrefix'
A trivial solution consists in repeating the required properties in each file(I definitely don't want this solution).
How can i do otherwise ?
question from:
https://stackoverflow.com/questions/66052895/spring-boot-starter-quartz-jdbc-vs-memory-jobstore-in-different-environement 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…