#============================================================== ==============
# Configure Main Scheduler Properties
#========================================================================== ==
org.quartz.scheduler.instanceName = MultiservicioScheduler
org.quartz.scheduler.instanceId = AUTO
#====================================================================== ======
# Configure ThreadPool
#========================================================================== ==
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 1
org.quartz.threadPool.threadPriority = 5
#====================================================================== ======
# Configure Plugins
#========================================================================== ==
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin
org.quartz.plugin.jobInitializer.fileName =\ /home/resource/Schedule/job.xml
org.quartz.plugin.jobInitializer.overWriteExistingJobs = false
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
#org.quartz.plugin.jobInitializer.useContextClassLoader = true
org.quartz.plugin.jobInitializer.validating = false
org.quartz.plugin.jobInitializer.validatingSchema = false
org.quartz.plugin.jobInitializer.scanInterval = 30
#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = true
org.quartz.jobStore.dataSource = multiservicios
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
============================================================================
# Configure Datasources
#===========================================================================
# Define the datasource to use
org.quartz.dataSource.multiservicios.driver = com.ibm.db2.jcc.DB2Driver
org.quartz.dataSource.multiservicios.URL = jdbc:db2://10.232.234.114:50000/PROVIS
org.quartz.dataSource.multiservicios.user = provis
org.quartz.dataSource.multiservicios.password = provis
org.quartz.dataSource.multiservicios.maxConnections = 30
项目需求,整理了下quartz配置,在此记下quartz版本1.8.6
#===============================================================
# Configure Main Scheduler Properties
#===============================================================
org.quartz.scheduler.instanceName = quartzScheduler
org.quartz.scheduler.instanceId = AUTO
#RAMJobStore(jdbc store)
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
#ThreadPool config
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
#===============================================================
# Configure Plugin Properties
#TriggerFiredMessage
#Element Data Type Description
#0 String The Trigger's Name.
#1 String The Trigger's Group.
#2 Date The scheduled fire time.
#3 Date The next scheduled fire time.
#4 Date The actual fire time.
#5 String The Job's name.
#6 String The Job's group.
#7 Integer The re-fire count from the JobExecutionContext.
#The default message text is "Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}"
#TriggerCompleteMessage - available message data are: Element Data Type Description
#0 String The Trigger's Name.
#1 String The Trigger's Group.
#2 Date The scheduled fire time.
#3 Date The next scheduled fire time.
#4 Date The job completion time.
#5 String The Job's name.
#6 String The Job's group.
#7 Integer The re-fire count from the JobExecutionContext.
#8 Integer The trigger's resulting instruction code.
#9 String A human-readable translation of the trigger's resulting instruction code.
#The default message text is "Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy} with resulting trigger instruction code: {9}"
#===============================================================
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
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}
org.quartz.plugin.jobInitializer.class =org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames=jobs.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound = false
org.quartz.plugin.jobInitializer.scanInterval = 600
org.quartz.plugin.jobInitializer.wrapInUserTransaction =false
org.quartz.scheduler.skipUpdateCheck = true
org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true
job.xml
<?xml version="1.0" encoding="UTF-8"?>
<job-scheduling-data
xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
version="1.8"
>
<pre-processing-commands>
<delete-jobs-in-group>*</delete-jobs-in-group> <!-- clear all jobs in scheduler -->
<delete-triggers-in-group>*</delete-triggers-in-group> <!-- clear all triggers in scheduler -->
</pre-processing-commands>
<processing-directives>
<overwrite-existing-data>true</overwrite-existing-data>
<ignore-duplicates>false</ignore-duplicates>
</processing-directives>
<schedule>
<job>
<name>TestTask</name>
<group>TestTaskGroup</group>
<description>定时运行Job</description>
<job-class>quertz.TestTask</job-class>
<volatility>false</volatility>
<durability>true</durability>
<recover>false</recover>
</job>
<trigger>
<cron>
<name>FooTrigger</name>
<group>TestTaskGroup</group>
<job-name>TestTask</job-name>
<job-group>TestTaskGroup</job-group>
<misfire-instruction>MISFIRE_INSTRUCTION_FIRE_ONCE_NOW</misfire-instruction>
<cron-expression>0 0/1 * * * ?</cron-expression>
</cron>
</trigger>
</schedule>
</job-scheduling-data>