I have some scheduled tasks in a Spring application and they were configured like this:
<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<!-- Here the list of tasks -->
</list>
</property>
</bean>
I'm having some issues (some tasks doesn't run when they should but not always just after a long time or at certain times) and I think it may be because there are many tasks (11 so far) and the system can't run them at the same time. I have thought of setting org.quartz.threadPool.threadCount
like this to increment the number of parallel threads:
<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<!-- Here the list of tasks -->
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.threadPool.threadCount">15</prop>
</props>
</property>
</bean>
But I wonder, how many threads was the system using when I was not setting the org.quartz.threadPool.threadCount
property? What is the default behaviour?
When googling "SchedulerFactoryBean.java" first link(SchedulerFactoryBean.java) with source code i opened had:
public static final int DEFAULT_THREAD_COUNT = 10;
This value is used later to set org.quartz.threadPool.threadCount in initSchedulerFactory method:
mergedProps.setProperty(PROP_THREAD_COUNT, Integer.toString(DEFAULT_THREAD_COUNT));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With