/** * Configure a {@link Function} that will be invoked at runtime to determine the destination to * which a message will be sent. Typically used with a Java 8 Lambda expression: * <pre class="code"> * {@code * .remoteTimeout(m -> m.getHeaders().get('rto')) * } * </pre> * @param remoteTimeoutFunction the function. * @param <P> the message payload type. * @return the spec. * @see TcpOutboundGateway#setRemoteTimeoutExpression(org.springframework.expression.Expression) */ public <P> TcpOutboundGatewaySpec remoteTimeout(Function<Message<P>, ?> remoteTimeoutFunction) { this.target.setRemoteTimeoutExpression(new FunctionExpression<>(remoteTimeoutFunction)); return _this(); }
Mockito.eq(Long.class))).thenReturn(50L, 10000L); gateway.setRemoteTimeoutExpression(remoteTimeoutExpression);
gateway.setRequiresReply(true); gateway.setOutputChannel(replyChannel); gateway.setRemoteTimeoutExpression(new SpelExpressionParser().parseExpression("5000")); gateway.setBeanFactory(mock(BeanFactory.class)); gateway.afterPropertiesSet();
gateway.setRequiresReply(true); gateway.setOutputChannel(replyChannel); gateway.setRemoteTimeoutExpression(new SpelExpressionParser().parseExpression("5000")); gateway.setBeanFactory(mock(BeanFactory.class)); gateway.afterPropertiesSet();
/** * Configure a {@link Function} that will be invoked at runtime to determine the destination to * which a message will be sent. Typically used with a Java 8 Lambda expression: * <pre class="code"> * {@code * .remoteTimeout(m -> m.getHeaders().get('rto')) * } * </pre> * @param remoteTimeoutFunction the function. * @param <P> the message payload type. * @return the spec. * @see TcpOutboundGateway#setRemoteTimeoutExpression(org.springframework.expression.Expression) */ public <P> TcpOutboundGatewaySpec remoteTimeout(Function<Message<P>, ?> remoteTimeoutFunction) { this.target.setRemoteTimeoutExpression(new FunctionExpression<>(remoteTimeoutFunction)); return _this(); }