Which executor and scheduler is getting used

I was reading below article to implement executor and scheduler.

http://docs.spring.io/spring/docs/current/spring-framework-reference/html/scheduling.html#scheduling-enable-annotation-support

Can any one please tell me which executor and scheduler does it use when we specify below xml entry

<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
<task:executor id="myExecutor" pool-size="5"/>
<task:scheduler id="myScheduler" pool-size="10"/>

Answer

Internally spring uses org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor for namespace of task:executor and org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler for task:scheduler.

Refer respective API docs here and here

Leave a Reply

Your email address will not be published. Required fields are marked *