public DelayerEndpointSpec delayExpression(Expression delayExpression) { this.handler.setDelayExpression(delayExpression); return this; }
public DelayerEndpointSpec delayExpression(String delayExpression) { this.handler.setDelayExpression(PARSER.parseExpression(delayExpression)); return this; }
/** * Specify the function to determine delay value against {@link Message}. * Typically used with a Java 8 Lambda expression: * <pre class="code"> * {@code * .<Foo>delay("delayer", m -> m.getPayload().getDate(), * c -> c.advice(this.delayedAdvice).messageStore(this.messageStore())) * } * </pre> * @param delayFunction the {@link Function} to determine delay. * @param <P> the payload type. * @return the endpoint spec. */ public <P> DelayerEndpointSpec delayFunction(Function<Message<P>, Object> delayFunction) { this.handler.setDelayExpression(new FunctionExpression<>(delayFunction)); return this; }
private void setDelayExpression() { Expression expression = new SpelExpressionParser().parseExpression("headers.delay"); this.delayHandler.setDelayExpression(expression); }
public DelayerEndpointSpec delayExpression(Expression delayExpression) { this.handler.setDelayExpression(delayExpression); return this; }
@Test public void testRescheduleForTheDateDelay() throws Exception { this.delayHandler.setDelayExpression(new SpelExpressionParser().parseExpression("payload")); this.delayHandler.setOutputChannel(new DirectChannel()); this.delayHandler.setIgnoreExpressionFailures(false);
public DelayerEndpointSpec delayExpression(String delayExpression) { this.handler.setDelayExpression(PARSER.parseExpression(delayExpression)); return this; }
/** * Specify the function to determine delay value against {@link Message}. * Typically used with a Java 8 Lambda expression: * <pre class="code"> * {@code * .<Foo>delay("delayer", m -> m.getPayload().getDate(), * c -> c.advice(this.delayedAdvice).messageStore(this.messageStore())) * } * </pre> * @param delayFunction the {@link Function} to determine delay. * @param <P> the payload type. * @return the endpoint spec. */ public <P> DelayerEndpointSpec delayFunction(Function<Message<P>, Object> delayFunction) { this.handler.setDelayExpression(new FunctionExpression<>(delayFunction)); return this; }
private B delay(String groupId, Expression expression, Consumer<DelayerEndpointSpec> endpointConfigurer) { DelayHandler delayHandler = new DelayHandler(groupId); if (expression != null) { delayHandler.setDelayExpression(expression); } return this.register(new DelayerEndpointSpec(delayHandler), endpointConfigurer); }
private B delay(String groupId, Expression expression, Consumer<DelayerEndpointSpec> endpointConfigurer) { DelayHandler delayHandler = new DelayHandler(groupId); if (expression != null) { delayHandler.setDelayExpression(expression); } return this.register(new DelayerEndpointSpec(delayHandler), endpointConfigurer); }