Splitter Flow Control Reference
in Mulesoft
• The Splitter Flow Control splits a message into
separate fragments, then sends these
fragments one at a time to the next message
processor in the flow. Segments are identified
based on an expression parameter, usually
written in Mule Expression Language (MEL),
but other formats can be employed also. You
can then use a Collection Aggregator Flow
Control to reassemble the parts of the original
message.
• You can also include a Resequencer Flow Control
to put the parts back into the original sequence in
case they are shuffled out of order.
• Splitting and aggregating the message is
especially useful when you intend to process the
split parts in asynchronous flows running on
separate servers. Together, the splitter and
aggregator flow controls allow you to share the
workload among several servers and still be able
to reassemble the message after it's processed.
• Splitter Configuration
• Simple Splitter
• Advanced Splitter Including a Child Element
• Basic Splitter Example
• Full Example Code
• Aggregating the Payload
• Aggregator Configuration
• Simple Collection Aggregator
• Advanced Collection Aggregator Including a Child
Element
• Example Splitting and Aggregating with
Asynchronous Flows
• Full Example Code
• Example Reordering Before Aggregating
• Full Example Code
Aggregating the Payload
• When the splitter splits a message, it adds three
new outbound variables into each of the output
fragments. These three variables are later used by
the Aggregator to reassemble the message:
• MULE_CORRELATION_GROUP_SIZE: number of
fragments into which the original message was split
• MULE_CORRELATION_SEQUENCE: position of a
fragment within the group
• MULE_CORRELATION_ID: single ID for entire group (all
output fragments of the same original message share
the same value)
• <flow name="splitterFlow1" doc:name="splitterFlow1">
• <http:listener config-ref="HTTP_Listener_Configuration" path="gettweets"
doc:name="HTTP"/>
• <splitter expression="#[xpath3('//actor')]" doc:name="Splitter"/>
• <vm:outbound-endpoint exchange-pattern="one-way" path="step2"
doc:name="VM"/>
• </flow>
• <flow name="splitterFlow2" doc:name="splitterFlow2">
• <vm:inbound-endpoint exchange-pattern="one-way" path="step2"
doc:name="VM"/>
• <logger level="INFO" doc:name="Logger" message="#[payload]"/>
• <resequencer failOnTimeout="true" doc:name="Resequencer"/>
• <logger message="#[payload]" level="INFO" doc:name="Logger"/>
• <collection-aggregator failOnTimeout="true" doc:name="Collection
Aggregator"/>
• <logger message="#[payload]" level="INFO" doc:name="Logger"/>
• </flow>

Splitter flow control reference

  • 1.
    Splitter Flow ControlReference in Mulesoft
  • 2.
    • The SplitterFlow Control splits a message into separate fragments, then sends these fragments one at a time to the next message processor in the flow. Segments are identified based on an expression parameter, usually written in Mule Expression Language (MEL), but other formats can be employed also. You can then use a Collection Aggregator Flow Control to reassemble the parts of the original message.
  • 3.
    • You canalso include a Resequencer Flow Control to put the parts back into the original sequence in case they are shuffled out of order. • Splitting and aggregating the message is especially useful when you intend to process the split parts in asynchronous flows running on separate servers. Together, the splitter and aggregator flow controls allow you to share the workload among several servers and still be able to reassemble the message after it's processed.
  • 4.
    • Splitter Configuration •Simple Splitter • Advanced Splitter Including a Child Element • Basic Splitter Example • Full Example Code • Aggregating the Payload
  • 5.
    • Aggregator Configuration •Simple Collection Aggregator • Advanced Collection Aggregator Including a Child Element • Example Splitting and Aggregating with Asynchronous Flows • Full Example Code • Example Reordering Before Aggregating • Full Example Code
  • 6.
    Aggregating the Payload •When the splitter splits a message, it adds three new outbound variables into each of the output fragments. These three variables are later used by the Aggregator to reassemble the message: • MULE_CORRELATION_GROUP_SIZE: number of fragments into which the original message was split • MULE_CORRELATION_SEQUENCE: position of a fragment within the group • MULE_CORRELATION_ID: single ID for entire group (all output fragments of the same original message share the same value)
  • 7.
    • <flow name="splitterFlow1"doc:name="splitterFlow1"> • <http:listener config-ref="HTTP_Listener_Configuration" path="gettweets" doc:name="HTTP"/> • <splitter expression="#[xpath3('//actor')]" doc:name="Splitter"/> • <vm:outbound-endpoint exchange-pattern="one-way" path="step2" doc:name="VM"/> • </flow> • <flow name="splitterFlow2" doc:name="splitterFlow2"> • <vm:inbound-endpoint exchange-pattern="one-way" path="step2" doc:name="VM"/> • <logger level="INFO" doc:name="Logger" message="#[payload]"/> • <resequencer failOnTimeout="true" doc:name="Resequencer"/> • <logger message="#[payload]" level="INFO" doc:name="Logger"/> • <collection-aggregator failOnTimeout="true" doc:name="Collection Aggregator"/> • <logger message="#[payload]" level="INFO" doc:name="Logger"/> • </flow>