/** * Populate a {@link BridgeHandler} to the current integration flow position. * @return the current {@link IntegrationFlowDefinition}. * @see #bridge(Consumer) */ public B bridge() { return bridge(null); }
/** * Populate the provided {@link MessageChannel} instance * at the current {@link IntegrationFlow} chain position. * The {@code messageChannel} can be an existing bean, or fresh instance, in which case * the {@link org.springframework.integration.dsl.context.IntegrationFlowBeanPostProcessor} * will populate it as a bean with a generated name. * @param messageChannel the {@link MessageChannel} to populate. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(MessageChannel messageChannel) { Assert.notNull(messageChannel, "'messageChannel' must not be null"); this.implicitChannel = false; if (this.currentMessageChannel != null) { bridge(); } this.currentMessageChannel = messageChannel; return registerOutputChannelIfCan(this.currentMessageChannel); }
/** * Populate a {@link WireTap} for the {@link #currentMessageChannel} * with the {@link LoggingHandler} subscriber for the provided * {@link LoggingHandler.Level} logging level, logging category * and SpEL expression for the log message. * <p> A {@link #bridge()} is added after this operator to make the flow reply-producing * if the {@code replyChannel} header is present. * <p> This operator can be used only in the end of flow. * @param level the {@link LoggingHandler.Level}. * @param category the logging category. * @param logExpression the {@link Expression} to evaluate logger message at runtime * against the request {@link Message}. * @return an {@link IntegrationFlow} instance based on this builder. * @see #log() * @see #bridge() */ public IntegrationFlow logAndReply(LoggingHandler.Level level, String category, Expression logExpression) { return log(level, category, logExpression) .bridge() .get(); }
/** * Populate a {@link BridgeHandler} to the current integration flow position. * @return the current {@link IntegrationFlowDefinition}. * @see #bridge(Consumer) */ public B bridge() { return bridge(null); }
/** * Populate the provided {@link MessageChannel} instance * at the current {@link IntegrationFlow} chain position. * The {@code messageChannel} can be an existing bean, or fresh instance, in which case * the {@link org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor} * will populate it as a bean with a generated name. * @param messageChannel the {@link MessageChannel} to populate. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(MessageChannel messageChannel) { Assert.notNull(messageChannel, "'messageChannel' must not be null"); if (this.currentMessageChannel != null) { bridge(null); } this.currentMessageChannel = messageChannel; return registerOutputChannelIfCan(this.currentMessageChannel); }
/** * Populate the provided {@link MessageChannel} instance * at the current {@link IntegrationFlow} chain position. * The {@code messageChannel} can be an existing bean, or fresh instance, in which case * the {@link org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor} * will populate it as a bean with a generated name. * @param messageChannel the {@link MessageChannel} to populate. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(MessageChannel messageChannel) { Assert.notNull(messageChannel, "'messageChannel' must not be null"); if (this.currentMessageChannel != null) { bridge(null); } this.currentMessageChannel = messageChannel; return registerOutputChannelIfCan(this.currentMessageChannel); }
this.integrationFlowContext .registration(flow -> flow .bridge(e -> e.role(testRole)) .channel(resultChannel)) .register();
/** * Populate the provided {@link MessageChannel} instance * at the current {@link IntegrationFlow} chain position. * The {@code messageChannel} can be an existing bean, or fresh instance, in which case * the {@link org.springframework.integration.dsl.context.IntegrationFlowBeanPostProcessor} * will populate it as a bean with a generated name. * @param messageChannel the {@link MessageChannel} to populate. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(MessageChannel messageChannel) { Assert.notNull(messageChannel, "'messageChannel' must not be null"); this.implicitChannel = false; if (this.currentMessageChannel != null) { bridge(); } this.currentMessageChannel = messageChannel; return registerOutputChannelIfCan(this.currentMessageChannel); }
/** * Populate a {@link WireTap} for the {@link #currentMessageChannel} * with the {@link LoggingHandler} subscriber for the provided * {@link LoggingHandler.Level} logging level, logging category * and SpEL expression for the log message. * <p> A {@link #bridge()} is added after this operator to make the flow reply-producing * if the {@code replyChannel} header is present. * <p> This operator can be used only in the end of flow. * @param level the {@link LoggingHandler.Level}. * @param category the logging category. * @param logExpression the {@link Expression} to evaluate logger message at runtime * against the request {@link Message}. * @return an {@link IntegrationFlow} instance based on this builder. * @see #log() * @see #bridge() */ public IntegrationFlow logAndReply(LoggingHandler.Level level, String category, Expression logExpression) { return log(level, category, logExpression) .bridge() .get(); }
@Bean @RequestScope public IntegrationFlow wrongScopeFlow() { return flow -> flow.bridge(null); }