Allow to define the pool size of a GroupedJob

Last modified by Vincent Massol on 2021/04/06

It is now possible to configure the pool of threads to be used for grouped jobs. To provide that configuration you need to declare a new component that implements org.xwiki.job.GroupedJobInitializer and whose method getId matches the JobGroupPath of the GroupedJob. You will be able to define the size of the pool of threads to be used for those jobs and the default priority of the threads. 

Note that the hierarchy of the JobGroupPath can be used to define the same configuration for a whole hierarchy of GroupedJobs.

New global configurations have been also added in xwiki.properties related to this feature:


#-# [Since 12.5RC1]
#-# The maximum number of entries to put in cache for the GroupedJobInitializer components.
#-# The default is 100.
# job.groupedJobInitializerCacheSize=100

#-# [Since 12.5RC1]
#-# The thread keep-alive time in milliseconds for the single job executor.
#-# This value defines how long a thread can be idle before being terminated by the executor.
#-# The default value is 60000 for 60 000ms.
# job.singleJobThreadKeepAliveTime=60000

#-# [Since 12.5RC1]
#-# The thread keep-alive time in milliseconds for the grouped job executors.
#-# This value defines how long a thread can be idle before being terminated by an executor.
#-# The default value is 60000 for 60 000ms.
# job.groupedJobThreadKeepAliveTime=60000
Tags:
   

Get Connected