Configuration Reference

Configure ThreadPool Settings

Property Name Required Type Default Value
org.quartz.threadPool.class yes string (class name) null
org.quartz.threadPool.threadCount yes int -1
org.quartz.threadPool.threadPriority no int Thread.NORM_PRIORITY (5)

org.quartz.threadPool.class

Is the name of the ThreadPool implementation you wish to use. The threadpool that ships with Quartz is “org.quartz.simpl.SimpleThreadPool”, and should meet the needs of nearly every user. It has very simple behavior and is very well tested. It provides a fixed-size pool of threads that ‘live’ the lifetime of the Scheduler.

org.quartz.threadPool.threadCount

Can be any positive integer, although you should realize that only numbers between 1 and 100 are very practical. This is the number of threads that are available for concurrent execution of jobs. If you only have a few jobs that fire a few times a day, then 1 thread is plenty! If you have tens of thousands of jobs, with many firing every minute, then you probably want a thread count more like 50 or 100 (this highly depends on the nature of the work that your jobs perform, and your systems resources!).

org.quartz.threadPool.threadPriority

Can be any int between Thread.MIN_PRIORITY (which is 1) and Thread.MAX_PRIORITY (which is 10). The default is Thread.NORM_PRIORITY (5).

SimpleThreadPool-Specific Properties

Property Name Required Type Default Value
org.quartz.threadPool.makeThreadsDaemons no boolean false
org.quartz.threadPool.threadsInheritGroupOfInitializingThread no boolean true
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread no boolean false
org.quartz.threadPool.threadNamePrefix no string [Scheduler Name]_Worker

org.quartz.threadPool.makeThreadsDaemons

Can be set to “true” to have the threads in the pool created as daemon threads. Default is “false”. See also the org.quartz.scheduler.makeSchedulerThreadDaemon property.

org.quartz.threadPool.threadsInheritGroupOfInitializingThread

Can be “true” or “false”, and defaults to true.

org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread

Can be “true” or “false”, and defaults to false.

org.quartz.threadPool.threadNamePrefix

The prefix for thread names in the worker pool - will be postpended with a number.

Custom ThreadPools

If you use your own implementation of a thread pool, you can have properties set on it reflectively simply by naming the property as thus:

Setting Properties on a Custom ThreadPool

org.quartz.threadPool.class = com.mycompany.goo.FooThreadPool
org.quartz.threadPool.somePropOfFooThreadPool = someValue