use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project elastest-torm by elastest.
the class ElasTestTormApp method getAsyncExecutor.
@Override
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(4);
executor.setMaxPoolSize(6);
executor.setQueueCapacity(500);
executor.setThreadNamePrefix("ET-");
executor.initialize();
return executor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project hello-world by haoziapple.
the class AsyncConfiguration method getAsyncExecutor.
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("jh-app-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project cloudbreak by hortonworks.
the class AppConfig method intermediateBuilderExecutor.
@Bean
public AsyncTaskExecutor intermediateBuilderExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(intermediateCorePoolSize);
executor.setQueueCapacity(intermediateQueueCapacity);
executor.setThreadNamePrefix("intermediateBuilderExecutor-");
executor.setTaskDecorator(new MDCCleanerTaskDecorator());
executor.initialize();
return executor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project cloudbreak by hortonworks.
the class AppConfig method resourceBuilderExecutor.
@Bean
public AsyncTaskExecutor resourceBuilderExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(corePoolSize);
executor.setQueueCapacity(queueCapacity);
executor.setThreadNamePrefix("resourceBuilderExecutor-");
executor.setTaskDecorator(new MDCCleanerTaskDecorator());
executor.initialize();
return executor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project spring-framework by spring-projects.
the class WebSocketMessageBrokerStatsTests method inboundAndOutboundChannelsWithThreadPoolTaskExecutor.
@Test
void inboundAndOutboundChannelsWithThreadPoolTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.afterPropertiesSet();
stats.setInboundChannelExecutor(executor);
stats.setOutboundChannelExecutor(executor);
assertThat(stats.getClientInboundExecutorStatsInfo()).as("inbound channel stats").isEqualTo("pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0");
assertThat(stats.getClientOutboundExecutorStatsInfo()).as("outbound channel stats").isEqualTo("pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0");
}
Aggregations