use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project spring-framework by spring-projects.
the class MessageBrokerConfigurationTests method brokerChannelCustomized.
@Test
public void brokerChannelCustomized() {
AbstractSubscribableChannel channel = this.customContext.getBean("brokerChannel", AbstractSubscribableChannel.class);
assertEquals(4, channel.getInterceptors().size());
ThreadPoolTaskExecutor taskExecutor = this.customContext.getBean("brokerChannelExecutor", ThreadPoolTaskExecutor.class);
assertEquals(31, taskExecutor.getCorePoolSize());
assertEquals(32, taskExecutor.getMaxPoolSize());
assertEquals(33, taskExecutor.getKeepAliveSeconds());
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project metacat by Netflix.
the class CommonServerConfig method taskExecutor.
/**
* Get a task executor for executing tasks asynchronously that don't need to be scheduled at a recurring rate.
*
* @param metacatProperties The metacat properties to get number of executor threads from.
* Likely best to do one more than number of CPUs
* @return The task executor the system to use
*/
@Bean
public AsyncTaskExecutor taskExecutor(final MetacatProperties metacatProperties) {
final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(metacatProperties.getEvent().getBus().getExecutor().getThread().getCount());
return executor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor 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);
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project ocvn by devgateway.
the class AsyncConfiguration method getAsyncExecutor.
@Bean
@Override
public ThreadPoolTaskExecutor getAsyncExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setMaxPoolSize(1);
taskExecutor.setThreadNamePrefix("VNImportServiceExecutor-");
return taskExecutor;
}
Aggregations