Class IntegrationFlowDefinition<B extends IntegrationFlowDefinition<B>>
java.lang.Object
org.springframework.integration.dsl.BaseIntegrationFlowDefinition<B>
org.springframework.integration.dsl.IntegrationFlowDefinition<B>
- Type Parameters:
B
- theIntegrationFlowDefinition
implementation 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 Summary
Nested classes/interfaces inherited from class org.springframework.integration.dsl.BaseIntegrationFlowDefinition
BaseIntegrationFlowDefinition.ReplyProducerCleaner
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.BaseIntegrationFlowDefinition
integrationComponents, PARSER
-
Method Summary
Modifier and TypeMethodDescription<P> B
filter
(GenericSelector<P> genericSelector) <P> B
filter
(GenericSelector<P> genericSelector, Consumer<FilterEndpointSpec> endpointConfigurer) <P> B
handle
(GenericHandler<P> handler) Populate aServiceActivatingHandler
for theMethodInvokingMessageProcessor
to invoke the providedGenericHandler
at runtime.<P> B
handle
(GenericHandler<P> handler, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) Populate aServiceActivatingHandler
for theMethodInvokingMessageProcessor
to invoke the providedGenericHandler
at runtime.<S,
T> B Populate theMethodInvokingRouter
for providedFunction
with default options.<S,
T> B route
(Function<S, T> router, Consumer<RouterSpec<T, MethodInvokingRouter>> routerConfigurer) <P> B
split
(Function<P, ?> splitter, Consumer<SplitterEndpointSpec<MethodInvokingSplitter>> endpointConfigurer) Populate theMethodInvokingSplitter
to evaluate the providedFunction
at runtime.<S,
T> B transform
(GenericTransformer<S, T> genericTransformer) Populate theMessageTransformingHandler
instance for the providedGenericTransformer
.<S,
T> B transform
(GenericTransformer<S, T> genericTransformer, Consumer<GenericEndpointSpec<MessageTransformingHandler>> endpointConfigurer) Populate theMessageTransformingHandler
instance for the providedGenericTransformer
.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, 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, intercept, isImplicitChannel, isOutputChannelRequired, log, log, log, log, log, log, log, log, log, log, log, log, log, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, logAndReply, 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, to, toReactivePublisher, toReactivePublisher, transform, transform, transform, transform, transform, transform, transform, transform, transform, trigger, trigger, trigger, trigger, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap
-
Method Details
-
transform
Populate theMessageTransformingHandler
instance for the providedGenericTransformer
. UseBaseIntegrationFlowDefinition.transform(Class, GenericTransformer)
if you need to access the entire message.- Type Parameters:
S
- the source type - 'transform from'.T
- the target type - 'transform to'.- Parameters:
genericTransformer
- theGenericTransformer
to populate.- Returns:
- the current
IntegrationFlowDefinition
. - See Also:
-
transform
public <S,T> B transform(GenericTransformer<S, T> genericTransformer, Consumer<GenericEndpointSpec<MessageTransformingHandler>> endpointConfigurer) Populate theMessageTransformingHandler
instance for the providedGenericTransformer
. In addition, accept options for the integration endpoint usingGenericEndpointSpec
. UseBaseIntegrationFlowDefinition.transform(Class, GenericTransformer, Consumer)
if you need to access the entire message.- Type Parameters:
S
- the source type - 'transform from'.T
- the target type - 'transform to'.- Parameters:
genericTransformer
- theGenericTransformer
to populate.endpointConfigurer
- theConsumer
to provide integration endpoint options.- Returns:
- the current
IntegrationFlowDefinition
. - See Also:
-
filter
Populate aMessageFilter
withMethodInvokingSelector
for the providedGenericSelector
. Typically used with a Java 8 Lambda expression:.filter("World"::equals)
BaseIntegrationFlowDefinition.filter(Class, GenericSelector)
if you need to access the entire message.- Type Parameters:
P
- the source payload type.- Parameters:
genericSelector
- theGenericSelector
to use.- Returns:
- the current
IntegrationFlowDefinition
.
-
filter
public <P> B filter(GenericSelector<P> genericSelector, Consumer<FilterEndpointSpec> endpointConfigurer) Populate aMessageFilter
withMethodInvokingSelector
for the providedGenericSelector
. In addition accept options for the integration endpoint usingFilterEndpointSpec
. Typically used with a Java 8 Lambda expression:.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
- theGenericSelector
to use.endpointConfigurer
- theConsumer
to provide integration endpoint options.- Returns:
- the current
IntegrationFlowDefinition
. - See Also:
-
handle
Populate aServiceActivatingHandler
for theMethodInvokingMessageProcessor
to invoke the providedGenericHandler
at runtime. Typically used with a Java 8 Lambda expression:.<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:
-
handle
public <P> B handle(GenericHandler<P> handler, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) Populate aServiceActivatingHandler
for theMethodInvokingMessageProcessor
to invoke the providedGenericHandler
at runtime. In addition accept options for the integration endpoint usingGenericEndpointSpec
. Typically used with a Java 8 Lambda expression:.<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
- theConsumer
to provide integration endpoint options.- Returns:
- the current
IntegrationFlowDefinition
. - See Also:
-
split
public <P> B split(Function<P, ?> splitter, Consumer<SplitterEndpointSpec<MethodInvokingSplitter>> endpointConfigurer) Populate theMethodInvokingSplitter
to evaluate the providedFunction
at 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 splitterFunction
.endpointConfigurer
- theConsumer
to provide integration endpoint options.- Returns:
- the current
IntegrationFlowDefinition
. - See Also:
-
route
Populate theMethodInvokingRouter
for providedFunction
with default options. Typically used with a Java 8 Lambda expression:.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
- theFunction
to use.- Returns:
- the current
IntegrationFlowDefinition
.
-
route
public <S,T> B route(Function<S, T> router, Consumer<RouterSpec<T, MethodInvokingRouter>> routerConfigurer) Populate theMethodInvokingRouter
for providedFunction
with provided options fromRouterSpec
. In addition, accept options for the integration endpoint usingGenericEndpointSpec
. Typically used with a Java 8 Lambda expression:.<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
- theFunction
to use.routerConfigurer
- theConsumer
to provideMethodInvokingRouter
options.- Returns:
- the current
IntegrationFlowDefinition
.
-