A splitter is a Spring Integration component that turns one incoming message into multiple messages. Each resulting message can continue independently through different channels or subflows. section 10.2 section 10.2.5
Use a splitter when a payload contains a collection whose items need individual processing, or when related data belongs in different processing paths. A router can follow the splitter when the resulting payloads have different types. section 10.2.5
Splitting a purchase order
An OrderSplitter can extract billing information and line items from a purchase order, return them in a collection, and publish each element as a separate message. Annotate its bean with @Splitter(inputChannel="poChannel", outputChannel="splitOrderChannel") to connect the operation to the flow. A PayloadTypeRouter can then send BillingInfo and line-item messages to their respective channels. section 10.2.5
A second splitter can divide the line-item collection so each LineItem receives individual handling. The same flow can also use Java DSL operations such as split(), route(), subFlowMapping(), and handle() to express the split and its subflows.
