[ 
https://issues.apache.org/jira/browse/SLING-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15372393#comment-15372393
 ] 

Chetan Mehrotra commented on SLING-5831:
----------------------------------------

One way would be to handle this in 
{{o.a.s.commons.scheduler.impl.QuartzScheduler.QuartzThreadPool#runInThread}}. 
The runnable passed there is an instance of {{JobRunShell}}. Unfortunately it 
does not expose {{JobDetail}} directly that would need to be seen. High level

# Client code which register the Runnable in OSGi also specify a new service 
property. {{category}} (or poolName). The category is then used to lookup 
threadpool name. 
# This service property is passed as part of {{JobDataMap}}
# Have this info "somehow" extracted from {{JobDataMap}} in 
{{QuartzScheduler.QuartzThreadPool#runInThread}} and then that is used to 
lookup the thread pool. If none is present we use the default pool

Things could have been done in a cleaner way if it was possible to provide a 
custom {{JobRunShellFactory}} but {{DirectSchedulerFactory}} is tied to 
{{StdJobRunShellFactory}}

> Support different thread pools for scheduled tasks
> --------------------------------------------------
>
>                 Key: SLING-5831
>                 URL: https://issues.apache.org/jira/browse/SLING-5831
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Scheduler 2.4.16
>
>
> Right now the scheduler uses a single thread pool. While this thread pool can 
> be configured, it means that all scheduled tasks share this pool. In order to 
> prioratize different tasks over others and avoid blocking important jobs 
> through unimportant once, we could maybe add a configuration property to 
> select a thread pool name.
> If a pool with that name exists, it's used - if not the default is used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to