Created
February 18, 2014 10:29
-
-
Save ArloL/9068296 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EnableAsync | |
@EnableScheduling | |
public class AppConfiguration implements AsyncConfigurer { | |
@Override | |
public Executor getAsyncExecutor() { | |
return executor(); | |
} | |
@Bean | |
public Executor executor() { | |
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | |
executor.setMaxPoolSize(1); | |
return new ExceptionHandlingAsyncTaskExecutor(executor); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simpler version: