use of org.springframework.integration.channel.RendezvousChannel in project spring-integration by spring-projects.
the class ContentEnricherTests method requestChannelSendTimingOut.
@Test
public void requestChannelSendTimingOut() {
final String requestChannelName = "Request_Channel";
final long requestTimeout = 200L;
QueueChannel replyChannel = new QueueChannel();
QueueChannel requestChannel = new RendezvousChannel();
requestChannel.setBeanName(requestChannelName);
ContentEnricher enricher = new ContentEnricher();
enricher.setRequestChannel(requestChannel);
enricher.setRequestTimeout(requestTimeout);
enricher.setBeanFactory(mock(BeanFactory.class));
enricher.afterPropertiesSet();
Target target = new Target("replace me");
Message<?> requestMessage = MessageBuilder.withPayload(target).setReplyChannel(replyChannel).build();
try {
enricher.handleMessage(requestMessage);
} catch (MessageDeliveryException e) {
assertThat(e.getMessage(), equalToIgnoringCase("failed to send message to channel '" + requestChannelName + "' within timeout: " + requestTimeout));
}
}
Aggregations