Spring, Spring Boot, Spring Framework, Java, Programming.
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskExecutor()); } @Bean public Executor taskExecutor() { return Executors.newScheduledThreadPool(10); } } In such way we create ScheduledThreadPoolExecutor with pool size of 10 threads. Summary comparing