ThreadPoolTaskExecutor: configuration and usage

Other topics

application configuration

@Configuration
@EnableAsync
public class ApplicationConfiguration{
    
    @Bean
    public TaskExecutor getAsyncExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(2);
        executor.setThreadNamePrefix("executor-task-");
        executor.initialize();
        return executor;
    }
    
}

Contributors

Topic Id: 7497

Example Ids: 24743

This site is not affiliated with any of the contributors.