Created
May 31, 2023 15:07
-
-
Save levancho/fe9b4dbb41a0fcec0edf9fc58be7584e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Bean(name = "piTaskExecutor") | |
@Primary | |
public Executor piTaskExecutor() { | |
log.debug("Creating Async Task Executor"); | |
final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | |
executor.setCorePoolSize(4); | |
executor.setMaxPoolSize(10); | |
executor.setQueueCapacity(5); | |
executor.setAllowCoreThreadTimeOut(false); | |
executor.setThreadNamePrefix("PiExecutor-"); | |
executor.initialize(); | |
return executor; | |
} | |
@Autowired | |
RulesManager rules; | |
@Bean(name = "applicationEventMulticaster") | |
public ApplicationEventMulticaster simpleApplicationEventMulticaster(@Qualifier("piTaskExecutor") Executor piTaskExecutor) { | |
SimpleApplicationEventMulticaster eventMulticaster = | |
new SimpleApplicationEventMulticaster(); | |
eventMulticaster.setTaskExecutor(piTaskExecutor); | |
return eventMulticaster; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment