An @Async method in a @Service-annotated class is not being called asynchronously - it\'s blocking the thread.
I\'ve got
Try below:
1. In config create bean for ThreadPoolTaskExecutor
@Bean(name = "threadPoolTaskExecutor")
public Executor threadPoolTaskExecutor() {
return new ThreadPoolTaskExecutor();
}
2. In service method where @Async is used add
@Async("threadPoolTaskExecutor")
public void asyncMethod(){
//do something
}
This should get @Async working.