Interface IntegrationFlow

All Known Implementing Classes:
IntegrationFlowAdapter, StandardIntegrationFlow
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IntegrationFlow
The main Integration DSL abstraction.

The StandardIntegrationFlow implementation (produced by IntegrationFlowBuilder) represents a container for the integration components, which will be registered in the application context. Typically, is used as a @Bean definition:

  public IntegrationFlow fileReadingFlow() {
      return IntegrationFlow
             .from(Files.inboundAdapter(tmpDir.getRoot()), e -> e.poller(Pollers.fixedDelay(100)))

Can be used as a Lambda for top level definition as well as sub-flow definitions:

 public IntegrationFlow routerTwoSubFlows() {
     return f -> f
               .<Integer, Boolean>route(p -> p % 2 == 0, m -> m
                              .subFlowMapping(true, sf -> sf.<Integer>handle((p, h) -> p * 2))
                              .subFlowMapping(false, sf -> sf.<Integer>handle((p, h) -> p * 3)))


Also, this interface can be implemented directly to encapsulate the integration logic in the target service:

  public class MyFlow implements IntegrationFlow {

        public void configure(IntegrationFlowDefinition<?> f) {
                f.<String, String>transform(String::toUpperCase);

Artem Bilan, Gary Russell, Oleg Zhurakousky, Artem Vozhdayenko
See Also: