문서의 이전 판입니다!
@EnableAsync public class SpringAsyncConfig implements AsyncConfigurer { // 기본 taskExecutor @Override public Executor getAsyncExecutor() { return new ThreadPoolTaskExecutor(); // 객체 설정해줄것. } }
waitForTasksToCompleteOnShutdown=true
awaitTerminationSeconds=초
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); threadPoolTaskExecutor.setThreadNamePrefix("XXXX-"); threadPoolTaskExecutor.setCorePoolSize(10); threadPoolTaskExecutor.setMaxPoolSize(Integer.MAX_VALUE); threadPoolTaskExecutor.setQueueCapacity(0); threadPoolTaskExecutor.setKeepAliveSeconds(60); threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(true); threadPoolTaskExecutor.setAwaitTerminationSeconds(15);