RendezvousChannelSpec() { this.channel = new RendezvousChannel(); }
@Bean public PollableChannel rendezvousChannel() { return new RendezvousChannel(); }
RendezvousChannelSpec() { this.channel = new RendezvousChannel(); }
RendezvousChannelSpec() { this.channel = new RendezvousChannel(); }
RendezvousChannelSpec() { this.channel = new RendezvousChannel(); }
@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)); } }
@Bean public TcpConnectionFactoryFactoryBean connectionFactory() { TcpConnectionFactoryFactoryBean fact = new TcpConnectionFactoryFactoryBean(); fact.setType("server"); fact.setPort(5555); return fact; } @Bean public TcpInboundGateway gateway(AbstractConnectionFactory connectionFactory) throws Exception { TcpInboundGateway gate = new TcpInboundGateway(); gate.setConnectionFactory(connectionFactory); gate.setRequestChannel(new RendezvousChannel()); return gate; }
@Bean public TcpInboundGateway gateway(AbstractConnectionFactory connectionFactory) throws Exception { TcpInboundGateway gate = new TcpInboundGateway(); gate.setConnectionFactory(connectionFactory); gate.setRequestChannel(new RendezvousChannel()); return gate; } @Bean public TcpConnectionFactoryFactoryBean connectionFactory() { TcpConnectionFactoryFactoryBean fact = new TcpConnectionFactoryFactoryBean(); fact.setType("server"); fact.setPort(5555); return fact; }