Objective: Demonstrate the use of Iterate mediator to split the messages in to parts and process them asynchronously and then aggregate the responses coming in to ESB.
- Deploy the SimpleStockQuoteService in sample Axis2 server and start it on port 9000.
- Start ESB with the sample configuration 400 (i.e. wso2esb-samples -sn 400).
In this sample, the message sent to ESB has embedded with a number of elements of the same type in one message. When ESB received this message it will iterate through those elements and then sent to the specified endpoint. When all the responses appear in to ESB then those messages will be aggregated to form the resultant response and sent back to the client.
Invoke the client as follows.
Cache mediator can be used to utilize the network bandwidth, to protect the backend service from being loaded with the same type of requests like browser refresh actions and also to speed up the execution of the web service. This mediator should be used with sence, because it is not applicable for each and every service (for example services with dynamic responses for a particular release)