Class IntegrationFlowDefinition<B extends IntegrationFlowDefinition<B>>
java.lang.Object
org.springframework.integration.dsl.BaseIntegrationFlowDefinition<B>
org.springframework.integration.dsl.IntegrationFlowDefinition<B>
- Type Parameters:
- B- the- IntegrationFlowDefinitionimplementation type.
- Direct Known Subclasses:
- IntegrationFlowBuilder,- IntegrationFlowExtension
public abstract class IntegrationFlowDefinition<B extends IntegrationFlowDefinition<B>>
extends BaseIntegrationFlowDefinition<B>
The 
BaseIntegrationFlowDefinition extension for syntax sugar with generics for some
 type-based EIP-methods when an expected payload type is assumed from upstream.
 For more explicit type conversion the methods with a Class argument are recommended for use.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell, Gabriele Del Prete
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.dsl.BaseIntegrationFlowDefinitionBaseIntegrationFlowDefinition.ReplyProducerCleaner
- 
Field SummaryFields inherited from class org.springframework.integration.dsl.BaseIntegrationFlowDefinitionintegrationComponents, PARSER
- 
Method SummaryModifier and TypeMethodDescription<P> Bfilter(GenericSelector<P> genericSelector) <P> Bfilter(GenericSelector<P> genericSelector, Consumer<FilterEndpointSpec> endpointConfigurer) <P> Bhandle(GenericHandler<P> handler) Populate aServiceActivatingHandlerfor theMethodInvokingMessageProcessorto invoke the providedGenericHandlerat runtime.<P> Bhandle(GenericHandler<P> handler, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) Populate aServiceActivatingHandlerfor theMethodInvokingMessageProcessorto invoke the providedGenericHandlerat runtime.<S,T> B Populate theMethodInvokingRouterfor providedFunctionwith default options.<S,T> B route(Function<S, T> router, Consumer<RouterSpec<T, MethodInvokingRouter>> routerConfigurer) <P> Bsplit(Function<P, ?> splitter, Consumer<SplitterEndpointSpec<MethodInvokingSplitter>> endpointConfigurer) Deprecated, for removal: This API element is subject to removal in a future version.<S,T> B transform(GenericTransformer<S, T> genericTransformer) Populate theMessageTransformingHandlerinstance for the providedGenericTransformer.<S,T> B transform(GenericTransformer<S, T> genericTransformer, Consumer<GenericEndpointSpec<MessageTransformingHandler>> endpointConfigurer) Deprecated, for removal: This API element is subject to removal in a future version.since 6.2 in favor ofBaseIntegrationFlowDefinition.transformWith(Consumer)Methods inherited from class org.springframework.integration.dsl.BaseIntegrationFlowDefinition_this, addComponent, addComponent, addComponents, aggregate, aggregate, aggregate, barrier, barrier, bridge, bridge, channel, channel, channel, channel, checkReuse, claimCheckIn, claimCheckIn, claimCheckOut, claimCheckOut, claimCheckOut, controlBus, controlBus, convert, convert, currentComponent, currentInterceptableChannel, currentMessageChannel, delay, delay, delay, enrich, enrichHeaders, enrichHeaders, enrichHeaders, enrichHeaders, enrichHeaders, extractProxyTarget, filter, filter, filter, filter, filter, filter, filter, filter, filter, fixedSubscriberChannel, fixedSubscriberChannel, fluxTransform, gateway, gateway, gateway, gateway, gateway, gateway, get, getCurrentComponent, getCurrentMessageChannel, getIntegrationComponents, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handleReactive, handleReactive, handleReactive, handleReactive, headerFilter, headerFilter, headerFilter, headerFilter, intercept, isImplicitChannel, isOutputChannelRequired, log, log, log, log, log, log, log, log, log, log, log, log, log, nullChannel, obtainInputChannelFromFlow, publishSubscribeChannel, publishSubscribeChannel, publishSubscribeChannel, register, registerOutputChannelIfCan, resequence, resequence, route, route, route, route, route, route, route, route, route, route, route, route, route, route, routeByException, routeToRecipients, scatterGather, scatterGather, scatterGather, scatterGather, scatterGather, scatterGather, setImplicitChannel, split, split, split, split, split, split, split, split, split, split, split, split, split, split, split, split, split, splitWith, to, toReactivePublisher, toReactivePublisher, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transformWith, trigger, trigger, trigger, trigger, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap
- 
Method Details- 
transformPopulate theMessageTransformingHandlerinstance for the providedGenericTransformer. UseBaseIntegrationFlowDefinition.transform(Class, GenericTransformer)if you need to access the entire message. Shortcut for:.transformWith((transformerSpec) -> transformerSpec.function(genericTransformer))- Type Parameters:
- S- the source type - 'transform from'.
- T- the target type - 'transform to'.
- Parameters:
- genericTransformer- the- GenericTransformerto populate.
- Returns:
- the current IntegrationFlowDefinition.
- See Also:
 
- 
transform@Deprecated(since="6.2", forRemoval=true) public <S,T> B transform(GenericTransformer<S, T> genericTransformer, Consumer<GenericEndpointSpec<MessageTransformingHandler>> endpointConfigurer) Deprecated, for removal: This API element is subject to removal in a future version.since 6.2 in favor ofBaseIntegrationFlowDefinition.transformWith(Consumer)Populate theMessageTransformingHandlerinstance for the providedGenericTransformer. In addition, accept options for the integration endpoint usingGenericEndpointSpec. Use.transform((transformerSpec) -> transformerSpec.function(genericTransformer).expectedType(Message.class))if you need to access the entire message.- Type Parameters:
- S- the source type - 'transform from'.
- T- the target type - 'transform to'.
- Parameters:
- genericTransformer- the- GenericTransformerto populate.
- endpointConfigurer- the- Consumerto provide integration endpoint options.
- Returns:
- the current IntegrationFlowDefinition.
- See Also:
 
- 
filterPopulate aMessageFilterwithMethodInvokingSelectorfor the providedGenericSelector. Typically used with a Java 8 Lambda expression:
 Use.filter("World"::equals)BaseIntegrationFlowDefinition.filter(Class, GenericSelector)if you need to access the entire message.- Type Parameters:
- P- the source payload type.
- Parameters:
- genericSelector- the- GenericSelectorto use.
- Returns:
- the current IntegrationFlowDefinition.
 
- 
filterpublic <P> B filter(GenericSelector<P> genericSelector, Consumer<FilterEndpointSpec> endpointConfigurer) Populate aMessageFilterwithMethodInvokingSelectorfor the providedGenericSelector. In addition, accept options for the integration endpoint usingFilterEndpointSpec. Typically used with a Java 8 Lambda expression:
 Use.filter("World"::equals, e -> e.autoStartup(false))BaseIntegrationFlowDefinition.filter(Class, GenericSelector, Consumer)if you need to access the entire message.- Type Parameters:
- P- the source payload type.
- Parameters:
- genericSelector- the- GenericSelectorto use.
- endpointConfigurer- the- Consumerto provide integration endpoint options.
- Returns:
- the current IntegrationFlowDefinition.
- See Also:
 
- 
handlePopulate aServiceActivatingHandlerfor theMethodInvokingMessageProcessorto invoke the providedGenericHandlerat runtime. Typically used with a Java 8 Lambda expression:
 Use.<Integer>handle((p, h) -> p / 2)BaseIntegrationFlowDefinition.handle(Class, GenericHandler)if you need to access the entire message.- Type Parameters:
- P- the payload type to expect.
- Parameters:
- handler- the handler to invoke.
- Returns:
- the current IntegrationFlowDefinition.
- See Also:
 
- 
handlepublic <P> B handle(GenericHandler<P> handler, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) Populate aServiceActivatingHandlerfor theMethodInvokingMessageProcessorto invoke the providedGenericHandlerat runtime. In addition, accept options for the integration endpoint usingGenericEndpointSpec. Typically used with a Java 8 Lambda expression:
 Use.<Integer>handle((p, h) -> p / 2, e -> e.autoStartup(false))BaseIntegrationFlowDefinition.handle(Class, GenericHandler, Consumer)if you need to access the entire message.- Type Parameters:
- P- the payload type to expect.
- Parameters:
- handler- the handler to invoke.
- endpointConfigurer- the- Consumerto provide integration endpoint options.
- Returns:
- the current IntegrationFlowDefinition.
- See Also:
 
- 
split@Deprecated(since="6.2", forRemoval=true) public <P> B split(Function<P, ?> splitter, Consumer<SplitterEndpointSpec<MethodInvokingSplitter>> endpointConfigurer) Deprecated, for removal: This API element is subject to removal in a future version.since 6.2 in favor ofBaseIntegrationFlowDefinition.splitWith(Consumer).Populate theMethodInvokingSplitterto evaluate the providedFunctionat runtime. In addition, accept options for the integration endpoint usingGenericEndpointSpec. Typically used with a Java 8 Lambda expression:.<String>split(p -> jdbcTemplate.execute("SELECT * from FOO", (PreparedStatement ps) -> new ResultSetIterator<Foo>(ps.executeQuery(), (rs, rowNum) -> new Foo(rs.getInt(1), rs.getString(2)))) , e -> e.applySequence(false))- Type Parameters:
- P- the payload type.
- Parameters:
- splitter- the splitter- Function.
- endpointConfigurer- the- Consumerto provide integration endpoint options.
- Returns:
- the current IntegrationFlowDefinition.
- See Also:
 
- 
routePopulate theMethodInvokingRouterfor providedFunctionwith default options. Typically used with a Java 8 Lambda expression:
 Use.route(p -> p.equals("foo") || p.equals("bar") ? new String[] {"foo", "bar"} : null)BaseIntegrationFlowDefinition.route(Class, Function)if you need to access the entire message.- Type Parameters:
- S- the source payload type.
- T- the target result type.
- Parameters:
- router- the- Functionto use.
- Returns:
- the current IntegrationFlowDefinition.
 
- 
routepublic <S,T> B route(Function<S, T> router, Consumer<RouterSpec<T, MethodInvokingRouter>> routerConfigurer) Populate theMethodInvokingRouterfor providedFunctionwith provided options fromRouterSpec. In addition, accept options for the integration endpoint usingGenericEndpointSpec. Typically used with a Java 8 Lambda expression:
 Use.<Integer, Boolean>route(p -> p % 2 == 0, m -> m.channelMapping("true", "evenChannel") .subFlowMapping("false", f -> f.<Integer>handle((p, h) -> p * 3)) .applySequence(false))BaseIntegrationFlowDefinition.route(Class, Function, Consumer)if you need to access the entire message.- Type Parameters:
- S- the source payload type.
- T- the target result type.
- Parameters:
- router- the- Functionto use.
- routerConfigurer- the- Consumerto provide- MethodInvokingRouteroptions.
- Returns:
- the current IntegrationFlowDefinition.
 
 
- 
BaseIntegrationFlowDefinition.splitWith(Consumer).