Can't use @Async in spring boot
I want to use spring boot's Asynchronous mechanism, here is my code. @Slf4j @Configuration @EnableAsync public class AsyncConfig implements AsyncConfigurer { private static final int MAX_POOL_SIZE = 50; private static final int CORE_POOL_SIZE = 20; @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); taskExecutor.setBeanName("taskExecutor"); taskExecutor.setMaxPoolSize(MAX_POOL_SIZE); taskExecutor.setCorePoolSize(CORE_POOL_SIZE); taskExecutor.setThreadNamePrefix("async-task-thread-pool"); taskExecutor.setWaitForTasksToCompleteOnShut
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.