Showcase how Synapse can be used to split a message into multiple fragments using the iterate mediator, and process them separately. The sample also shows how to use the aggregate mediator to combine multiple messages into one.
In this sample, the message sent to Synapse is comprised of a number of elements of the same type. When Synapse receives this message it will iterate through those elements and then will send each of them to the specified endpoint as separate messages. When all the responses are received by Synapse, those messages will be aggregated to form the resultant response and will send back to the client.
To try this out invoke the sample client as follows.
The above command will send a request containing four fragments in it. The iterate mediator therefore will break up the message into four. You will notice that Axis2 server is receiving 4 requests from Synapse. Four responses from Axis2 will be combined into one by the aggregate mediator and sent back to the sample Axis2 client.