1. Parallel processing for Splitter
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. We can process parallel. The solution was
achieved by encapsulating the Collection-Splitter and Collection-
Aggregator within VM Outbound Endpoints, such that each item
within the collection is assigned to a separate VM thread which
then aggregates the resultant payload of each thread. Both VMs
were wrapped with the Request-Reply component, as shown
below, such that the Request-Reply component waits for all
asynchronous processes to complete and receives the
asynchronous response from the asynchronous flow
4. Parallel processing for Splitter
input: A list of objects
output: A list of processed objects
Mule constructs:
•collection-splitter router: To split the list of input objects
•vm transport: To queue the objects for parallel processing
•async router: To process a object asynchronously and in a mult-
threaded model
•collection-aggregator router: To aggregate the split and
processed objects back to a list for output
5. Parallel processing for Splitter -
JSON
{
"locations": {
"record": [
{
"id": 8817,
"loc": "New YORK CITY"
},
{
"id": 2873,
"loc": "United STATES"
},
{
"id": 1501,
"loc": "New YORK STATE"
}
]
}
}
6. Parallel processing for Splitter -
JSON
{
"locations": {
"record": [
{
"id": 8817,
"loc": "New YORK CITY"
},
{
"id": 2873,
"loc": "United STATES"
},
{
"id": 1501,
"loc": "New YORK STATE"
}
]
}
}