diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowDefinition.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowDefinition.java index 13b076bc66..83d7891a83 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowDefinition.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowDefinition.java @@ -210,7 +210,7 @@ public abstract class IntegrationFlowDefinition B handle(H messageHandler, Consumer> endpointConfigurer) { Assert.notNull(messageHandler, "'messageHandler' must not be null"); - return this.register(new GenericEndpointSpec(messageHandler), endpointConfigurer); + return this.register(new GenericEndpointSpec<>(messageHandler), endpointConfigurer); + } + + /** + * Populate a {@link BridgeHandler} to the current integration flow position. + * @return the current {@link IntegrationFlowDefinition}. + * @see #bridge(Consumer) + */ + public B bridge() { + return bridge(null); } /** @@ -1120,7 +1129,7 @@ public abstract class IntegrationFlowDefinition> endpointConfigurer) { - return this.register(new GenericEndpointSpec(new BridgeHandler()), endpointConfigurer); + return register(new GenericEndpointSpec<>(new BridgeHandler()), endpointConfigurer); } /** @@ -1191,7 +1200,7 @@ public abstract class IntegrationFlowDefinition f.gateway("processChannel", g -> g.replyChannel("replyChannel")) .log() - .bridge(null); + .bridge(); } @Bean diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java index 880bef710e..3b979a8725 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java @@ -136,7 +136,7 @@ public class ManualFlowTests { @Override public void configure(IntegrationFlowDefinition flow) { - flow.bridge(null); + flow.bridge(); } } @@ -283,7 +283,7 @@ public class ManualFlowTests { @Bean @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public IntegrationFlow wrongScopeFlow() { - return flow -> flow.bridge(null); + return IntegrationFlowDefinition::bridge; } }