Reputation: 63
I’m using spring boot 2 and quartz, flyway for table creations. When i schedule job there in nothing into db. Any ideas? My quartz config is in configuration app. Can someone shere correct yml quartz config file.
Regards
Upvotes: 1
Views: 2847
Reputation: 11
If you are using spring boot 2.1 then add in your application.properties files as follows
spring.quartz.jdbc.initialize-schema=ALWAYS
spring.quartz.jdbc.schema=classpath:tables_postgres.sql
the tables are created automatically
Thanks
references: https://docs.spring.io/spring-boot/docs/2.1.0.M1/reference/html/boot-features-quartz.html
Upvotes: 1
Reputation: 2503
Configure Quartz with springboot application.
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.makeSchedulerThreadDaemon = true
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.makeThreadsDaemons = true
org.quartz.threadPool.threadCount: 20
org.quartz.threadPool.threadPriority: 5
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.isClustered = false
org.quartz.jobStore.dataSource = myDs
org.quartz.jobStore.misfireThreshold = 25000
# Configure Datasources
Refer This Demo.
https://www.opencodez.com/java/quartz-scheduler-with-spring-boot.htm https://github.com/davidkiss/spring-boot-quartz-demo
Upvotes: 1