The Spring documentation states that:
ThreadPoolTaskScheduler actually implements the Spring TaskExecutor interface, so that one instance can be used for asynchronous execution as soon as possible, as well as scheduled and potentially recurring executions.
So, what are the scenarios in which we would like to use an instance of ThreadPoolTaskExecutor for an instance of ThreadPoolTaskScheduler ?
I am currently using Spring XML. I create a bean of ThreadPoolTaskScheduler as follows:
<task:scheduler id="myScheduler" pool-size="1"/>
while the bean of the ThreadPoolTaskExecutor instance can be created as
<task:executor id="executor" pool-size="10"/>
spring scheduled-tasks threadpoolexecutor task executor
chammu
source share