Allow configuring custom ThreadPoolTaskExecutor

Issue: SPR-12272
This commit is contained in:
Rossen Stoyanchev
2014-09-29 23:02:40 -04:00
parent 179b236608
commit 521bbfcf56
4 changed files with 29 additions and 35 deletions

View File

@@ -132,8 +132,8 @@ public class MessageBrokerConfigurationTests {
assertEquals(2, channel.getInterceptors().size());
ThreadPoolTaskExecutor taskExecutor = this.customContext.getBean(
"clientInboundChannelExecutor", ThreadPoolTaskExecutor.class);
CustomThreadPoolTaskExecutor taskExecutor = this.customContext.getBean(
"clientInboundChannelExecutor", CustomThreadPoolTaskExecutor.class);
assertEquals(11, taskExecutor.getCorePoolSize());
assertEquals(12, taskExecutor.getMaxPoolSize());
@@ -489,7 +489,8 @@ public class MessageBrokerConfigurationTests {
@Override
protected void configureClientInboundChannel(ChannelRegistration registration) {
registration.setInterceptors(this.interceptor);
registration.taskExecutor().corePoolSize(11).maxPoolSize(12).keepAliveSeconds(13).queueCapacity(14);
registration.taskExecutor(new CustomThreadPoolTaskExecutor())
.corePoolSize(11).maxPoolSize(12).keepAliveSeconds(13).queueCapacity(14);
}
@Override
@@ -540,4 +541,7 @@ public class MessageBrokerConfigurationTests {
}
}
private static class CustomThreadPoolTaskExecutor extends ThreadPoolTaskExecutor {
}
}