İki tane alan mecburi. Açıklamalar burada
1. org.quartz.jobStore.dataSource
1. org.quartz.jobStore.driverDelegateClass
1. jobStore .dataSource
Örnek
Şöyle yaparız
spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX spring.quartz.properties.org.quartz.jobStore.dataSource=CityTasksQuartzDS
Örnek
Şöyle yaparız
##Server Port server.port = 8099 ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) spring.datasource.url = jdbc:postgresql://localhost:5432/scheduler spring.datasource.username = postgres spring.datasource.password = ## QuartzProperties 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.threadPool.threadCount = 5
2. jobStore .driverDelegateClass
Açıklaması şöyle
Adopt the driverDelegateClass to your database platform — just check the classes in the package org.quarzt.impl.jdbcjobstore to choose from.
Örnek - PostgreSQLDelegate
Şöyle yaparız
spring: quartz: job-store-type: jdbc jdbc: initialize-schema: never startup-delay: 60s properties: org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
store-type Alanı
MEMORY veya JDBC seçilebilir. Açıklaması şöyle
Quartz comes with its own in-built JobStores, and if you need you can create your own by implementing org.quartz.spi.JobStore interface. In spring-boot quartz provides two JobStoresMEMORY— It keeps all of its data in RAM so once the application ends or crashes all the scheduling information is lost. Since it keeps its data in RAM, it is very fast and simple to configureJDBC — JDBC JobStore keeps all of its data in a database via JDBC. Since it relies on database, configuration is a bit complicated and certainly is not as fast as RAM JobStore
store-type=JDBC
JDBC kullanacaksak bir DataSource tanımlı olmalıdır. Açıklaması şöyle
If you need to manage jobs on your own and modify them time to time without effecting the up-time of your application you should move to the JDBC job store. You can run clustered or non-clustered scheduler service when using the JDBC job store.
Örnek - jdbc
Şöyle yaparız
spring.quartz.job-store-type=jdbc spring.quartz.jdbc.initialize-schema=never
Örnek - jdbc
Şöyle yaparız. Burada datasource tanımı da var
spring.datasource.platform=org.hibernate.dialect.MySQL5Dialectspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://localhost:3306/quartz_demo_dbspring.datasource.username=rootspring.datasource.password=adminspring.jpa.open-in-view=falsespring.jpa.show-sql=truespring.quartz.job-store-type=jdbcspring.quartz.jdbc.initialize-schema=never
threadpool Alanı
Örnek
Şöyle yaparız
spring.quartz.job-store-type = jdbcspring.quartz.properties.org.quartz.threadPool.threadCount = 5
Açıklaması şöyle
Each Quartz Scheduler must has a unique ID. The value can be any string but must be unique for all schedulers. If we need we can AUTO generate this id by adding the property
Örnek
Şöyle yaparız
#QUARTZ CONFIGSspring.quartz.job-store-type=jdbcspring.quartz.jdbc.initialize-schema=neverspring.quartz.properties.org.quartz.scheduler.instanceName=quartz-demo-appspring.quartz.properties.org.quartz.scheduler.instanceId=AUTOspring.quartz.properties.org.quartz.scheduler.instanceIdGenerator.class=com.helixz.quartz.demo.component.CustomQuartzInstanceIdGeneratorspring.quartz.properties.org.quartz.threadPool.threadCount=20spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTXspring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegatespring.quartz.properties.org.quartz.jobStore.useProperties=truespring.quartz.properties.org.quartz.jobStore.misfireThreshold=60000spring.quartz.properties.org.quartz.jobStore.tablePrefix=qrtz_spring.quartz.properties.org.quartz.jobStore.isClustered=truespring.quartz.properties.org.quartz.plugin.shutdownHook.class=org.quartz.plugins.management.ShutdownHookPluginspring.quartz.properties.org.quartz.plugin.shutdownHook.cleanShutdown=TRUE
quartz.properties Dosyası
Eğer tüm ayarları application.properties dosyasına doldurmak istemiyorsak quartz.properties dosyası da kullanılabilir.
Örnek
Şöyle yaparız
org.quartz.scheduler.instanceName=sample org.quartz.scheduler.instanceId=AUTO org.quartz.scheduler.rmi.export=false org.quartz.scheduler.rmi.proxy=false org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount=3 org.quartz.context.key.QuartzTopic=QuartzProperties 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=true org.quartz.jobStore.dataSource=sample org.quartz.dataSource.sample.provider=hikaricp org.quartz.dataSource.sample.URL = jdbc:h2:mem:test;MODE=MySQL org.quartz.dataSource.sample.driver = org.h2.Driver serverTimezone=UTC&characterEncoding=UTF-8 org.quartz.dataSource.sample.user = sa
Hiç yorum yok:
Yorum Gönder