Quartz配置文件详解&生产配置

目录

         Configure Main Scheduler Properties

Configure ThreadPool

Configure JobStore

Configure Datasources 数据源

Configure Plugins 插件配置

ShutdownHookPlugin插件的配置样例

Configuring a Global TriggerListener 配置全局的Trigger监听器

Configuring a Global JobListener 配置全局的Job监听器

Configure TerracottaJobStore

生产环境配置简化版


 

Configure Main Scheduler Properties

 

#============================================================================
# Configure Main Scheduler Properties
#============================================================================

# 在集群中每个实例都必须有一个唯一的instanceId,但是应该有一个相同的instanceName【默认“QuartzScheduler”】【非必须】
org.quartz.scheduler.instanceName = DefaultScheduler
# Scheduler实例ID,全局唯一,【默认值NON_CLUSTERED】,或者可以使用“SYS_PROP”通过系统属性设置id。【非必须】
org.quartz.scheduler.instanceId = AUTO

# 只有在”org.quartz.scheduler.instanceId”设置为”AUTO”的时候才使用该属性设置。
# 默认情况下,“org.quartz.simpl.SimpleInstanceIdGenerator”是基于instanceId和时间戳来自动生成的。
# 其他的id生成器的实现包括 SystemPropertyInstanceIdGenerator 从系统属性获取 “org.quartz.scheduler.instanceId”, 和 HostnameInstanceIdGenerator 使用主机名 (InetAddress.getLocalHost().getHostName())。也可以自定义生成方式【默认org.quartz.simpl.SimpleInstanceIdGenerator】【非必须】
#org.quartz.scheduler.instanceIdGenerator.class = org.quartz.simpl.SimpleInstanceIdGenerator

# 指定线程名,如果不指定的话,会自动使用org.quartz.scheduler.instanceName属性值加上后缀字符串”_QuartzSchedulerThread”.【默认instanceName+’_QuartzSchedulerThread’】【非必须】
#org.quartz.scheduler.threadName =

# 指定scheduler的主线程是否为后台线程,【默认false】【非必须】
org.quartz.scheduler.makeSchedulerThreadDaemon = true

# 指定Quartz生成的线程是否继承初始化线程的上下文类加载器。这会影响Quartz的主调度线程、JDBCJobStore的”熄火”处理线程、集群回复线程和线程池里的线程。 将该值设置为“true”可以帮助类加载,JNDI查找,并在应用程序服务器上使用Quartz等相关问题,【默认false】【非必须】
#org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer = false


# 在调度程序空闲的时候,重复查询是否有可用触发器的等待时间。通常并不会设置为true,除非你是用XA事务,并且延迟触发会导致问题的场景。 5000ms以下是不推荐的,因为它会导致过的的数据库查询。1000ms以下是非法的。【默认30000】【非必须】
#org.quartz.scheduler.idleWaitTime = 30000

# 连接超时重试连接的间隔。使用 RamJobStore时,该参数并没什么用【默认15000】【非必须】
#org.quartz.scheduler.dbFailureRetryInterval = 15000

# 最可靠的方式就是使用【默认”org.quartz.simpl.CascadingClassLoadHelper”】,没必要指定其他类【非必须】
#org.quartz.scheduler.classLoadHelper.class = org.quartz.simpl.CascadingClassLoadHelper

# 指定JobFactory的类(接口)名称。负责实例化jobClass。【默认”org.quartz.simpl.PropertySettingJobFactory”】,只是在job被执行的时候简单调用newInstance()实例化一个job类。PropertySettingJobFactory 会使用反射机制通过SchedulerContext、 Job、Trigger和 JobDataMaps设置job bean的属性。在使用JTA事务时,可设置事务相关的属性【非必须】
#org.quartz.scheduler.jobFactory.class = org.quartz.simpl.PropertySettingJobFactory
#org.quartz.context.key.SOME_KEY = none

# 设置Quartz能够加载UserTransaction换利器的JNDI的 URL。Websphere 的用户可能会设置为“jta/usertransaction。只有在Quartz使用JobStoreCMT的时候,才会使用该属性,并且org.quartz.scheduler.wrapJobExecutionInUserTransaction也会设置为true。默认【默认值是”java:comp/UserTransaction”】【非必须】
#org.quartz.scheduler.userTransactionURL = java:comp/UserTransaction

# 如果想使用Quartz在执行一个job前使用UserTransaction,则应该设置该属性为true。job执行完、在JobDataMap改变之后事务会提交。默认值是false。 可以在你的job类中使用 @ExecuteInJTATransaction注解, 可以控制job是否使用事务。【默认false】【非必须】
#org.quartz.scheduler.wrapJobExecutionInUserTransaction = false

# 建议设置为“org.terracotta.quartz.skipUpdateCheck=true”不会在程序运行中还去检查quartz是否有版本更新。【默认false】【非必须】
#org.quartz.scheduler.skipUpdateCheck = true

# 许调度程序一次性触发的触发器数量。.默认值是1。值越大一次性触发的任务就可以越多,但是在集群环境【非必须】下,不建议设置为很大值。如果值 > 1, 并且使用了 JDBC JobStore的话, org.quartz.jobStore.acquireTriggersWithinLock属性必须设置为true,以避免”弄脏”数据。【默认1】
#org.quartz.scheduler.batchTriggerAcquisitionMaxCount = 1

# 允许触发器被获取并在其预定的触发时间之前触发的数量。【默认0】【非必须】
#org.quartz.scheduler.batchTriggerAcquisitionFireAheadTimeWindow = 0
Property NameReq'dTypeDefault Value
org.quartz.scheduler.instanceNamenostring'QuartzScheduler'
org.quartz.scheduler.instanceIdnostring'NON_CLUSTERED'
org.quartz.scheduler.instanceIdGenerator.classnostring (class name)org.quartz.simpl
.SimpleInstanceIdGenerator
org.quartz.scheduler.threadNamenostringinstanceName
+ '_QuartzSchedulerThread'
org.quartz.scheduler
.makeSchedulerThreadDaemon
nobooleanfalse
org.quartz.scheduler
.threadsInheritContextClassLoaderOfInitializer
nobooleanfalse
org.quartz.scheduler.idleWaitTimenolong30000
org.quartz.scheduler.dbFailureRetryIntervalnolong15000
org.quartz.scheduler.classLoadHelper.classnostring (class name)org.quartz.simpl
.CascadingClassLoadHelper
org.quartz.scheduler.jobFactory.classnostring (class name)org.quartz.simpl.PropertySettingJobFactory
org.quartz.context.key.SOME_KEYnostringnone
org.quartz.scheduler.userTransactionURLnostring (url)'java:comp/UserTransaction'
org.quartz.scheduler
.wrapJobExecutionInUserTransaction
nobooleanfalse
org.quartz.scheduler.skipUpdateChecknobooleanfalse
org.quartz.scheduler
.batchTriggerAcquisitionMaxCount
noint1
org.quartz.scheduler
.batchTriggerAcquisitionFireAheadTimeWindow
nolong0

 

 

Configure ThreadPool

 

#============================================================================
# Configure ThreadPool
#============================================================================

# 线程池的实现类(定长线程池,几乎可满足所有用户的需求)【默认null】【必须】
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool


# 指定线程数,至少为1(无默认值)(一般设置为1-100直接的整数合适)【默认-1】【必须】
org.quartz.threadPool.threadCount = 25

# 设置线程的优先级(最大为java.lang.Thread.MAX_PRIORITY 10,最小为Thread.MIN_PRIORITY 1)【默认Thread.NORM_PRIORITY (5)】【非必须】
org.quartz.threadPool.threadPriority = 5

# ------------------设置SimpleThreadPool的一些属性,一般使用默认值-------------------------------
# 设置是否为守护线程
org.quartz.threadPool.makeThreadsDaemons = true

#org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true

#org.quartz.threadpool.threadsinheritgroupofinitializingthread = false

#线程前缀默认值是:[Scheduler Name]_Worker
#org.quartz.threadpool.threadnameprefix = QuartzJobThead;


# ------------------------配置全局监听(TriggerListener,JobListener) 则应用程序可以接收和执行 预定的事件通知

# Configuring a Global TriggerListener 配置全局的Trigger监听器。
# MyTriggerListenerClass 类必须有一个无参数的构造函数,和 属性的set方法,目前2.2.x只支持原始数据类型的值(包括字符串)
#org.quartz.triggerListener.NAME.class = com.xxxx.MyTriggerListenerClass
#org.quartz.triggerListener.NAME.propName = propValue
#org.quartz.triggerListener.NAME.prop2Name = prop2Value


# Configuring a Global JobListener 配置全局的Job监听器
# MyJobListenerClass 类必须有一个无参数的构造函数,和 属性的set方法,目前2.2.x只支持原始数据类型的值(包括字符串)
#org.quartz.jobListener.NAME.class = com.xxxx.MyJobListenerClass
#org.quartz.jobListener.NAME.propName = propValue
#org.quartz.jobListener.NAME.prop2Name = prop2Value

Property NameRequiredTypeDefault Value
org.quartz.threadPool.classyesstring (class name)null
org.quartz.threadPool.threadCountyesint-1
org.quartz.threadPool.threadPrioritynointThread.NORM_PRIORITY (5)

 

SimpleThreadPool-Specific Properties

Property NameRequiredTypeDefault Value
org.quartz.threadPool.makeThreadsDaemonsnobooleanfalse
org.quartz.threadPool.threadsInheritGroupOfInitializingThreadnobooleantrue
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThreadnobooleanfalse
org.quartz.threadPool.threadNamePrefixnostring[Scheduler Name]_Worker

 

Configure JobStore

#============================================================================
# Configure JobStore
#============================================================================
# ------------------------使用RAMJobStore配置----------------------------------

# 将schedule相关信息保存在RAM中,轻量级,速度快,遗憾的是应用重启时相关信息都将丢失。
#org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
# # 最大能忍受的触发超时时间(触发器被认定为“misfired”之前),如果超过则认为“失误”【默认60秒】
#org.quartz.jobStore.misfireThreshold = 60000

# ------------------------使用JDBCJobStore配置----------------------------------
# 所有的quartz数据例如job和Trigger的细节信息被保存在内存或数据库中,
# 有两种实现:JobStoreTX(自己管理事务)和JobStoreCMT(application server管理事务,即全局事务JTA)
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

# 类似于Hibernate的dialect,用于处理DB之间的差异,StdJDBCDelegate能满足大部分的DB
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate

# 最大能忍受的触发超时时间(触发器被认定为“misfired”之前),如果超过则认为“失误”【默认60秒】
#org.quartz.jobStore.misfireThreshold = 60000

# 配置数据源的名称,在后面配置数据源的时候要用到,
# 例如org.quartz.dataSource.myQz.driver = com.mysql.jdbc.Driver
org.quartz.jobStore.dataSource = myQz

# 为了指示JDBCJobStore所有的JobDataMaps中的值都是字符串,并且能以“名字-值”对的方式存储而不是以复杂对象的序列化形式存储在BLOB字段中,应该设置为true(缺省方式)
org.quartz.jobStore.useProperties = false

# 数据表前缀
org.quartz.jobStore.tablePrefix = QRTZ_

# 是否集群、负载均衡、容错,如果应用在集群中设置为false会出错
org.quartz.jobStore.isClustered = true

# 检入到数据库中的频率(毫秒)。检查是否其他的实例到了应当检入的时候未检入这能指出一个失败的实例,且当前Scheduler会以此来接管执行失败并可恢复的Job通过检入操作,Scheduler也会更新自身的状态记录
org.quartz.jobStore.clusterCheckinInterval = 5000

# jobStore处理未按时触发的Job的数量
#org.quartz.jobStore.maxMisfiresToHandleAtATime = 20

# true/false,true则调用connection的setAutoCommit(false)方法
org.quartz.jobStore.dontSetAutoCommitFalse = true

# 加锁的SQL语句,默认为SELECT * FROM {0}LOCKS WHERE LOCK_NAME = ? FOR UPDATE
# {0}=$@org.quartz.jobStore.tablePrefix
#org.quartz.jobStore.selectWithLockSQL = false

# true/false, true则调用connection的setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE) 方法
#org.quartz.jobStore.txIsolationLevelSerializable = false

# 触发job时是否需要拥有锁
org.quartz.jobStore.acquireTriggersWithinLock = true

# 用于管理数据库中相关信息的锁机制的类名
#org.quartz.jobStore.lockHandler.class =

org.quartz.jobStore.misfireThreshold = 60000

Setting The Scheduler’s JobStore to JobStoreTX

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

JobStoreTX can be tuned with the following properties:

Property NameRequiredTypeDefault Value
org.quartz.jobStore.driverDelegateClassyesstringnull
org.quartz.jobStore.dataSourceyesstringnull
org.quartz.jobStore.tablePrefixnostring"QRTZ_"
org.quartz.jobStore.usePropertiesnobooleanfalse
org.quartz.jobStore.misfireThresholdnoint60000
org.quartz.jobStore.isClusterednobooleanfalse
org.quartz.jobStore.clusterCheckinIntervalnolong15000
org.quartz.jobStore.maxMisfiresToHandleAtATimenoint20
org.quartz.jobStore.dontSetAutoCommitFalsenobooleanfalse
org.quartz.jobStore.selectWithLockSQLnostring"SELECT * FROM {0}LOCKS WHERE SCHED_NAME = {1} AND LOCK_NAME = ? FOR UPDATE"
org.quartz.jobStore.txIsolationLevelSerializablenobooleanfalse
org.quartz.jobStore.acquireTriggersWithinLocknobooleanfalse (or true - see doc below)
org.quartz.jobStore.lockHandler.classnostringnull
org.quartz.jobStore.driverDelegateInitStringnostringnull

 

Setting The Scheduler’s JobStore to JobStoreCMT

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT

JobStoreCMT can be tuned with the following properties:

Property NameRequiredTypeDefault Value
org.quartz.jobStore.driverDelegateClassyesstringnull
org.quartz.jobStore.dataSourceyesstringnull
org.quartz.jobStore.nonManagedTXDataSourceyesstringnull
org.quartz.jobStore.tablePrefixnostring"QRTZ_"
org.quartz.jobStore.usePropertiesnobooleanfalse
org.quartz.jobStore.misfireThresholdnoint60000
org.quartz.jobStore.isClusterednobooleanfalse
org.quartz.jobStore.clusterCheckinIntervalnolong15000
org.quartz.jobStore.maxMisfiresToHandleAtATimenoint20
org.quartz.jobStore.dontSetAutoCommitFalsenobooleanfalse
org.quartz.jobStore.dontSetNonManagedTXConnectionAutoCommitFalsenobooleanfalse
org.quartz.jobStore.selectWithLockSQLnostring"SELECT * FROM {0}LOCKS WHERE SCHED_NAME = {1} AND LOCK_NAME = ? FOR UPDATE"
org.quartz.jobStore.txIsolationLevelSerializablenobooleanfalse
org.quartz.jobStore.txIsolationLevelReadCommittednobooleanfalse
org.quartz.jobStore.acquireTriggersWithinLocknobooleanfalse (or true - see doc below)
org.quartz.jobStore.lockHandler.classnostringnull
org.quartz.jobStore.driverDelegateInitStringnostringnull

 

Configure Datasources 数据源

#============================================================================
# Configure Datasources 数据源
#============================================================================

# ------------------------使用常规数据源配置
# 数据库驱动
org.quartz.dataSource.myQz.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.myQz.URL = jdbc:mysql://localhost:3306/quartz?characterEncoding=utf8
org.quartz.dataSource.myQz.user = root
org.quartz.dataSource.myQz.password = root

# 数据库最大连接数(如果Scheduler很忙,比如执行的任务与线程池的数量差不多相同,那就需要配置DataSource的连接数量为线程池数量+1)
org.quartz.dataSource.NAME.maxConnections = 30

# dataSource用于检测connection是否failed/corrupt的SQL语句
org.quartz.dataSource.NAME.validationQuery=select RAND()

# ------------------------使用JNDI数据源配置

# JNDI URL
#org.quartz.dataSource.NAME.jndiURL =

# JNDI InitialContextFactory
#org.quartz.dataSource.NAME.java.naming.factory.initial =

# 后三行为连接到JNDI提供者的相关信息
#org.quartz.dataSource.NAME.java.naming.provider.url =
#org.quartz.dataSource.NAME.java.naming.security.principal =
#org.quartz.dataSource.NAME.java.naming.security.credentials =

# ------------------------用户自定义org.quartz.utils.ConnectionProvider实现类
#org.quartz.dataSource.NAME.connectionProvider.class =
#org.quartz.dataSource.NAME.XXX =

#实现故障处理和负载均衡,实现高可用性和扩展性通过共享DB Tables实现,所以必须使用JDBC-Jobstore
#负载均衡 : 谁先触发谁执行,并且一次只有一个scheduler触发
#故障处理 : 当一个scheduler失败后,其它的实例可以发现那些执行失败的Jobs,假如Job对应的JobDetail标记为recovery(属性"requests recovery"),那么该Job就会被其它的实例重新执行,否则对应的Job只会被释放等待下次被触发。
#
#实现:
#org.quartz.jobStore.isClustered = true
#所有的实例的quartz.properties文件除了org.quartz.scheduler.instanceId和org.quartz.threadPool.threadCount必须一致,org.quartz.scheduler.instanceId = AUTO 即可实现ID的不一致
#注意:
#
#1.不在不同的机器上实现集群功能,除非他们的时钟同步精确到秒
#2.不实现集群的实例不使用同一套表

 

Quartz-created DataSources are defined with the following properties:

Property NameRequiredTypeDefault Value
org.quartz.dataSource.NAME.driveryesStringnull
org.quartz.dataSource.NAME.URLyesStringnull
org.quartz.dataSource.NAME.usernoString""
org.quartz.dataSource.NAME.passwordnoString""
org.quartz.dataSource.NAME.maxConnectionsnoint10
org.quartz.dataSource.NAME.validationQuerynoStringnull
org.quartz.dataSource.NAME.idleConnectionValidationSecondsnoint50
org.quartz.dataSource.NAME.validateOnCheckoutnobooleanfalse
org.quartz.dataSource.NAME.discardIdleConnectionsSecondsnoint

0 (disabled)

References to Application Server DataSources are defined with the following properties:

Property NameRequiredTypeDefault Value
org.quartz.dataSource.NAME.jndiURLyesStringnull
org.quartz.dataSource.NAME.java.naming.factory.initialnoStringnull
org.quartz.dataSource.NAME.java.naming.provider.urlnoStringnull
org.quartz.dataSource.NAME.java.naming.security.principalnoStringnull
org.quartz.dataSource.NAME.java.naming.security.credentialsnoStringnull

Custom ConnectionProvider Implementations

Property NameRequiredTypeDefault Value
org.quartz.dataSource.NAME.connectionProvider.classyesString (class name)null

 

Configure Plugins 插件配置

#============================================================================
# Configure Plugins 插件配置
#============================================================================

# 配置trigger执行历史日志(可以看到类的文档和参数列表)
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin
org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}
org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy} with resulting trigger instruction code: {9}

# 加载 Job 和 Trigger 信息的类 (1.8之前用:org.quartz.plugins.xml.JobInitializationPlugin)
#org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin

# 指定存放调度器(Job 和 Trigger)信息的xml文件,默认是classpath下quartz_jobs.xml
#org.quartz.plugin.jobInitializer.fileNames = quartz_data.xml
#org.quartz.plugin.jobInitializer.failOnFileNotFound = true

# 覆盖任务调度器中同名的jobDetail,避免只修改了CronExpression所造成的不能重新生效情况
#org.quartz.plugin.jobInitializer.overWriteExistingJobs = true

# 自动扫描任务单并发现改动的时间间隔,单位为秒。设置为0表示不自动加载
#org.quartz.plugin.jobInitializer.scanInterval = 120

# 覆盖任务调度器中同名的jobDetail,避免只修改了CronExpression所造成的不能重新生效情况
#org.quartz.plugin.jobInitializer.wrapInUserTransaction = false

ShutdownHookPlugin插件的配置样例

# ===========================================================================

# Sample configuration of ShutdownHookPlugin  ShutdownHookPlugin插件的配置样例

# ===========================================================================

#org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
#org.quartz.plugin.shutdownhook.cleanShutdown = true

# Configure RMI Settings 远程服务调用配置
# 如果你想quartz-scheduler出口本身通过RMI作为服务器,然后设置“出口”标志true(默认值为false)。

#org.quartz.scheduler.rmi.export = false

# 主机上rmi注册表(默认值localhost)
#org.quartz.scheduler.rmi.registryhost = localhost

# 注册监听端口号(默认值1099)
#org.quartz.scheduler.rmi.registryport = 1099

# 创建rmi注册,false/never:如果你已经有一个在运行或不想进行创建注册
# true/as_needed:第一次尝试使用现有的注册,然后再回来进行创建

# always:先进行创建一个注册,然后再使用回来使用注册
#org.quartz.scheduler.rmi.createregistry = never

#Quartz Scheduler服务端端口,默认是随机分配RMI注册表
#org.quartz.scheduler.rmi.serverport = 1098

# true:链接远程服务调度(客户端),这个也要指定registryhost和registryport,默认为false
# 如果export和proxy同时指定为true,则export的设置将被忽略

 

Property NameRequiredDefault Value
org.quartz.scheduler.rmi.exportnofalse
org.quartz.scheduler.rmi.registryHostno'localhost'
org.quartz.scheduler.rmi.registryPortno1099
org.quartz.scheduler.rmi.createRegistryno'never'
org.quartz.scheduler.rmi.serverPortnorandom
org.quartz.scheduler.rmi.proxynofalse

 

Configuring a Global TriggerListener 配置全局的Trigger监听器


 

# ===========================================================================

# Configuring a Global TriggerListener 配置全局的Trigger监听器
# MyTriggerListenerClass 类必须有一个无参数的构造函数,和 属性的set方法,目前2.2.x只支持原始数据类型的值(包括字符串)

# ===========================================================================

#org.quartz.triggerListener.NAME.class = com.xxxx.MyTriggerListenerClass
#org.quartz.triggerListener.NAME.propName = propValue
#org.quartz.triggerListener.NAME.prop2Name = prop2Value

Configuring a Global JobListener 配置全局的Job监听器

# ===========================================================================

# Configuring a Global JobListener 配置全局的Job监听器
# MyJobListenerClass 类必须有一个无参数的构造函数,和 属性的set方法,目前2.2.x只支持原始数据类型的值(包括字符串)

# ===========================================================================

#org.quartz.jobListener.NAME.class = com.xxxx.MyJobListenerClass
#org.quartz.jobListener.NAME.propName = propValue
#org.quartz.jobListener.NAME.prop2Name = prop2Value

Configure TerracottaJobStore

Setting The Scheduler’s JobStore to TerracottaJobStore

   
org.quartz.jobStore.class = org.terracotta.quartz.TerracottaJobStore

TerracottaJobStore can be tuned with the following properties:

Property NameRequiredTypeDefault Value
org.quartz.jobStore.tcConfigUrlyesstring 
org.quartz.jobStore.misfireThresholdnoint60000


生产环境配置简化版



#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.dataSource.myQz.driver = com.mysql.jdbc.Driver
#org.quartz.dataSource.myQz.driver = org.postgresql.Driver
org.quartz.dataSource.myQz.URL = jdbc:mysql://localhost:3306/dolphinscheduler?characterEncoding=utf8
#org.quartz.dataSource.myQz.URL = jdbc:postgresql://localhost:5432/dolphinscheduler?characterEncoding=utf8
org.quartz.dataSource.myQz.user = root
org.quartz.dataSource.myQz.password = root

org.quartz.scheduler.instanceName = DolphinScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.makeSchedulerThreadDaemon = true
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.acquireTriggersWithinLock = true

#============================================================================
# Configure ThreadPool
#============================================================================

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.makeThreadsDaemons = true
org.quartz.threadPool.threadCount = 25
org.quartz.threadPool.threadPriority = 5

#============================================================================
# Configure JobStore
#============================================================================
 
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.clusterCheckinInterval = 5000
org.quartz.jobStore.dataSource = myQz

#============================================================================
# Configure Datasources  
#============================================================================
org.quartz.dataSource.myQz.maxConnections = 10
org.quartz.dataSource.myQz.validationQuery = select 1

 

 

参考地址:

http://www.quartz-scheduler.org/documentation/quartz-2.3.0/configuration/

https://blog.csdn.net/weixin_33861800/article/details/86363985

 

 

 

 

 

 

 

  • 4
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值