Class IntegrationFlowDefinition<B extends IntegrationFlowDefinition<B>>
java.lang.Object
org.springframework.integration.dsl.BaseIntegrationFlowDefinition<B>
org.springframework.integration.dsl.IntegrationFlowDefinition<B>
- Type Parameters:
B- theIntegrationFlowDefinitionimplementation 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> 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) <S,T> B transform(GenericTransformer<S, T> genericTransformer) Populate theMessageTransformingHandlerinstance 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, controlBusOnRegistry, controlBusOnRegistry, 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, 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, splitWith, to, toReactivePublisher, toReactivePublisher, transform, transform, transform, transform, transform, transform, transformWith, trigger, trigger, trigger, trigger, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap
-
Method Details
-
transform
Populate 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- theGenericTransformerto populate.- Returns:
- the current
IntegrationFlowDefinition. - See Also:
-
filter
Populate 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- theGenericSelectorto use.- Returns:
- the current
IntegrationFlowDefinition.
-
filter
public <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- theGenericSelectorto use.endpointConfigurer- theConsumerto provide integration endpoint options.- Returns:
- the current
IntegrationFlowDefinition. - See Also:
-
handle
Populate 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:
-
handle
public <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- theConsumerto provide integration endpoint options.- Returns:
- the current
IntegrationFlowDefinition. - See Also:
-
route
Populate 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- theFunctionto use.- Returns:
- the current
IntegrationFlowDefinition.
-
route
public <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- theFunctionto use.routerConfigurer- theConsumerto provideMethodInvokingRouteroptions.- Returns:
- the current
IntegrationFlowDefinition.
-