Search in sources :

Example 1 with ExceptionHandlingAsyncTaskExecutor

use of pl.morecraft.dev.settler.configuration.util.ExceptionHandlingAsyncTaskExecutor in project Settler by EmhyrVarEmreis.

the class AsyncConfiguration method getAsyncExecutor.

@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(settlerProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(settlerProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(settlerProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("settler-Executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
Also used : ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) ExceptionHandlingAsyncTaskExecutor(pl.morecraft.dev.settler.configuration.util.ExceptionHandlingAsyncTaskExecutor) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)1 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)1 ExceptionHandlingAsyncTaskExecutor (pl.morecraft.dev.settler.configuration.util.ExceptionHandlingAsyncTaskExecutor)1