...
Before digging into implementation details, let's take a look at the relationship between the example scenario and the Splitter EIP by comparing their core components.
Splitter EIP (Figure 1) | Splitter Example Scenario (Figure 2) |
---|---|
New Order Request | Stock Quote Request |
Splitter | Iterate Mediator |
Order Item Request | Endpoint (stock quote service instances) |
Environment setup
- Download and install WSO2 ESB from http://wso2.com/products/enterprise-service-bus. For a list of prerequisites and step-by-step installation instructions, refer to Getting Started Installation Guide in the WSO2 ESB documentation.
- Start a Sample Axis2 server instance. For instructions, refer to the section Setting up the ESB Samples Setup - Starting Sample Back-End Servicesthe Axis2 server in the WSO2 ESB documentation.
...
Start the ESB server and log into its management console UI (https:
//localhost:9443/carbon
). In the management console, navigate navigate to the Main Menu, click Service Bus and then Source View menu and click Source View in the Service Bus section. Next, copy and paste the following configuration, which helps you explore the example scenario, to the source view.
Anchor | ||||
---|---|---|---|---|
|
...
Note that the three requests will appear as sent in the Axis2 server log.
You view the following output in the Axis2 Console:
samples.services.SimpleStockQuoteService :: Generating quote for : IBM
samples.services.SimpleStockQuoteService :: Generating quote for : IBM
samples.services.SimpleStockQuoteService :: Generating quote for : WSO2
Also, you view the following output in the Soap UI.
How the implementation works
Let's investigate the elements of the ESB configuration in detail. The line numbers below are mapped with the ESB configuration shown above.
- iterate [line 7 6 in ESB config] - The Iterate mediator takes each child element of the element specified in its XPath expression and applies the sequence flow inside the iterator mediator. In this example, it takes each
getQuote
request specified in the incoming request to the ESB and forwards this request to the target endpoint.