It is mentioned in the Spring documentation that:
ThreadPoolTaskScheduler
actually implements Spring'sTaskExecutor
interface as well, so that a single instance can be used for asynchronous execution as soon as possible as well as scheduled, and potentially recurring, executions.
So which are the scenarios where we would want to use ThreadPoolTaskExecutor
instance over ThreadPoolTaskScheduler
instance?
I am using currently using Spring XML. I am creating bean of ThreadPoolTaskScheduler
as follows:
<task:scheduler id="myScheduler" pool-size="1"/>
while bean of ThreadPoolTaskExecutor
instance can be created as
<task:executor id="executor" pool-size="10"/>