/** * Populate a {@link DelayHandler} to the current integration flow position * with default options. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @return the current {@link IntegrationFlowDefinition}. */ public B delay(String groupId) { return this.delay(groupId, null); }
@Bean public IntegrationFlow delayFlow() { return flow -> flow .delay(GROUP_ID, e -> e .messageStore(messageGroupStore) .id("delayer")) .channel(MessageChannels.queue("delayedResults")); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with default options. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @return the current {@link IntegrationFlowDefinition}. */ public B delay(String groupId) { return this.delay(groupId, null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided options. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see DelayerEndpointSpec */ public B delay(String groupId, Consumer<DelayerEndpointSpec> endpointConfigurer) { return this.delay(groupId, (String) null, endpointConfigurer); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided options. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see DelayerEndpointSpec */ public B delay(String groupId, Consumer<DelayerEndpointSpec> endpointConfigurer) { return this.delay(groupId, (String) null, endpointConfigurer); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with default options. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @return the current {@link IntegrationFlowDefinition}. */ public B delay(String groupId) { return this.delay(groupId, (String) null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayExpression}. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param expression the delay SpEL expression. * @return the current {@link IntegrationFlowDefinition}. */ public B delay(String groupId, String expression) { return this.delay(groupId, expression, null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayFunction}. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param function the delay {@link Function}. * @param <P> the expected payload type. * @return the current {@link IntegrationFlowDefinition}. * @see FunctionExpression */ public <P> B delay(String groupId, Function<Message<P>, Object> function) { return this.delay(groupId, function, null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with default options. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @return the current {@link IntegrationFlowDefinition}. */ public B delay(String groupId) { return this.delay(groupId, (String) null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayExpression}. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param expression the delay SpEL expression. * @return the current {@link IntegrationFlowDefinition}. */ public B delay(String groupId, String expression) { return this.delay(groupId, expression, null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayFunction}. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param function the delay {@link Function}. * @param <P> the expected payload type. * @return the current {@link IntegrationFlowDefinition}. * @see FunctionExpression */ public <P> B delay(String groupId, Function<Message<P>, Object> function) { return this.delay(groupId, function, null); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayExpression}. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param expression the delay SpEL expression. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see DelayerEndpointSpec */ public B delay(String groupId, String expression, Consumer<DelayerEndpointSpec> endpointConfigurer) { return delay(groupId, StringUtils.hasText(expression) ? PARSER.parseExpression(expression) : null, endpointConfigurer); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayExpression}. * @param groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param expression the delay SpEL expression. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see DelayerEndpointSpec */ public B delay(String groupId, String expression, Consumer<DelayerEndpointSpec> endpointConfigurer) { return delay(groupId, StringUtils.hasText(expression) ? PARSER.parseExpression(expression) : null, endpointConfigurer); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayFunction}. * 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 groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param function the delay {@link Function}. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @param <P> the expected payload type. * @return the current {@link IntegrationFlowDefinition}. * @see FunctionExpression * @see DelayerEndpointSpec */ public <P> B delay(String groupId, Function<Message<P>, Object> function, Consumer<DelayerEndpointSpec> endpointConfigurer) { return this.delay(groupId, new FunctionExpression<Message<P>>(function), endpointConfigurer); }
/** * Populate a {@link DelayHandler} to the current integration flow position * with provided {@code delayFunction}. * 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 groupId the {@code groupId} for delayed messages in the * {@link org.springframework.integration.store.MessageGroupStore}. * @param function the delay {@link Function}. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @param <P> the expected payload type. * @return the current {@link IntegrationFlowDefinition}. * @see FunctionExpression * @see DelayerEndpointSpec */ public <P> B delay(String groupId, Function<Message<P>, Object> function, Consumer<DelayerEndpointSpec> endpointConfigurer) { return this.delay(groupId, new FunctionExpression<Message<P>>(function), endpointConfigurer); }
@Bean public IntegrationFlow delayFlow() { return flow -> flow.delay(GROUP_ID, (String) null, e -> e.messageStore(messageGroupStore).id("delayer")) .channel(c -> c.queue("delayedResults")); }