Message Chunk Splitter & Message Chunk Aggregator in Mule

Message Chunk Splitter & Message Chunk Aggregator in Mule

Message Chunk Splitter splits message in form of chunks or fixed size message.We need to define size of message in configuration settings of Message Chunk Splitter.

Message Chunk Aggregator aggregates the splitted message in original form.

The Aggregators module contains different types of aggregators capable of storing values and releasing them all together based on the configuration specified. An Aggregator is a component used to collect those values until a condition is met, then execute a processor’s chain with the list of aggregated elements as the payload.

An Aggregator is a pass-through router, meaning that the same message that is processed by the aggregator is going to be processed by the components that follow it. The only modifications are the addition of some message attributes that provide information about the aggregation.

The basic aggregator configuration consists of the definition of the value that will be aggregated (extracted from the message through an expression evaluation), a condition that defines when the aggregation is considered complete, and a processor chain that will be executed once that condition is met.

flow of Message Chunk Splitter & Message Chunk Aggregator

Message Chunk Splitter configuration :

splitted files are located in a folder named splitted in src/main/resources

Message chunk aggregator configuration : As i said, nothing is required to configure inside it, so leave as it is.

URL : http://localhost:8085/api/chunksplitter
Method : POST

Input :


Output :

XML project code :

<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:file="" xmlns:dw="" xmlns:metadata="" xmlns:http="" xmlns:mulexml="" xmlns:wmq="" xmlns="" xmlns:doc="" xmlns:spring="" xmlns:xsi="" xsi:schemaLocation=""> <http:listener-config name="HTTP_Listener_Configuration" host="" port="8085" basePath="/api" doc:name="HTTP Listener Configuration"/> <file:connector name="File" writeToDirectory="./src/main/resources/splitter" autoDelete="false" streaming="false" validateConnections="true" doc:name="File"/> <flow name="test_messagechunksplitterFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/chunksplitter" doc:name="HTTP"/> <message-chunk-splitter messageSize="256" doc:name="Message Chunk Splitter"/> <file:outbound-endpoint path="./src/main/resources/splitter" connector-ref="File" responseTimeout="10000" mimeType="application/xml" doc:name="File"/> <message-chunk-aggregator failOnTimeout="true" doc:name="Message Chunk Aggregator"/> <set-payload value="#[payload]" doc:name="Set Payload"/> </flow> </mule>

© 2020

Share on :

Mule 4:

XML to JSON in mule 4 Web service consumer VM Validation in Mule 4 Until Successful
Sub flow Set Variable & Remove Variable Set Transaction ID Scatter Gather Round Robin
Consume Restful Service CRUD in Mule 4 Parse Template Object to JSON Load Static Resource
JSON to XML Invoke Idempotent Filter ForEach Flat file to JSON
Fixwidth to JSON First Successful File Execute Error Handling
Email Dynamic Evaluate Custom Business Event CSV to JSON Copybook to JSON
Choice Router Async RabbitMQ

Mule 3:

Database Connector Async CXF Attachement XSLT
Mongo DB Cache scope Custom Business Event Gzip Compress Expression
SMTP For Each Expression Javascript Filter Reference
Salesforce Message Enricher Groovy Parse Template Idempotent
VM Poll Invoke Ruby Message
Webservice consumer Python Transformer reference Message Property Not
Collection Aggregator First Sucessful Catch Exception Strategy Reference Exception Strategy Or
Choice Message Chunk Aggregator Choice Exception Strategy Global Exception Strategy Schema Validation
Custom Aggregator Scatter Gather Custom Exception Strategy Batch Processing MEL
M Unit RAML Map Operator API Mocking Dataweave