use of org.springframework.messaging.support.AbstractSubscribableChannel in project spring-framework by spring-projects.
the class TestValidator method testChannel.
private void testChannel(String channelName, List<Class<? extends MessageHandler>> subscriberTypes, int interceptorCount) {
AbstractSubscribableChannel channel = this.appContext.getBean(channelName, AbstractSubscribableChannel.class);
for (Class<? extends MessageHandler> subscriberType : subscriberTypes) {
MessageHandler subscriber = this.appContext.getBean(subscriberType);
assertThat(subscriber).as("No subscription for " + subscriberType).isNotNull();
assertThat(channel.hasSubscription(subscriber)).isTrue();
}
List<ChannelInterceptor> interceptors = channel.getInterceptors();
assertThat(interceptors.size()).isEqualTo(interceptorCount);
assertThat(interceptors.get(interceptors.size() - 1).getClass()).isEqualTo(ImmutableMessageChannelInterceptor.class);
}
use of org.springframework.messaging.support.AbstractSubscribableChannel in project spring-framework by spring-projects.
the class MessageBrokerConfigurationTests method clientInboundChannelCustomized.
@Test
public void clientInboundChannelCustomized() {
ApplicationContext context = loadConfig(CustomConfig.class);
AbstractSubscribableChannel channel = context.getBean("clientInboundChannel", AbstractSubscribableChannel.class);
assertThat(channel.getInterceptors().size()).isEqualTo(3);
CustomThreadPoolTaskExecutor taskExecutor = context.getBean("clientInboundChannelExecutor", CustomThreadPoolTaskExecutor.class);
assertThat(taskExecutor.getCorePoolSize()).isEqualTo(11);
assertThat(taskExecutor.getMaxPoolSize()).isEqualTo(12);
assertThat(taskExecutor.getKeepAliveSeconds()).isEqualTo(13);
}
use of org.springframework.messaging.support.AbstractSubscribableChannel in project spring-framework by spring-projects.
the class MessageBrokerConfigurationTests method clientOutboundChannelCustomized.
@Test
public void clientOutboundChannelCustomized() {
ApplicationContext context = loadConfig(CustomConfig.class);
AbstractSubscribableChannel channel = context.getBean("clientOutboundChannel", AbstractSubscribableChannel.class);
assertThat(channel.getInterceptors().size()).isEqualTo(4);
ThreadPoolTaskExecutor taskExecutor = context.getBean("clientOutboundChannelExecutor", ThreadPoolTaskExecutor.class);
assertThat(taskExecutor.getCorePoolSize()).isEqualTo(21);
assertThat(taskExecutor.getMaxPoolSize()).isEqualTo(22);
assertThat(taskExecutor.getKeepAliveSeconds()).isEqualTo(23);
SimpleBrokerMessageHandler broker = context.getBean("simpleBrokerMessageHandler", SimpleBrokerMessageHandler.class);
assertThat(broker.isPreservePublishOrder()).isTrue();
}
use of org.springframework.messaging.support.AbstractSubscribableChannel in project spring-framework by spring-projects.
the class MessageBrokerConfigurationTests method brokerChannelCustomized.
@Test
public void brokerChannelCustomized() {
ApplicationContext context = loadConfig(CustomConfig.class);
AbstractSubscribableChannel channel = context.getBean("brokerChannel", AbstractSubscribableChannel.class);
assertThat(channel.getInterceptors().size()).isEqualTo(4);
ThreadPoolTaskExecutor taskExecutor = context.getBean("brokerChannelExecutor", ThreadPoolTaskExecutor.class);
assertThat(taskExecutor.getCorePoolSize()).isEqualTo(31);
assertThat(taskExecutor.getMaxPoolSize()).isEqualTo(32);
assertThat(taskExecutor.getKeepAliveSeconds()).isEqualTo(33);
}
Aggregations