This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt Include
ESB Profile Samples
ESB Profile Samples

Objective: Demonstrate message routing to a set of static endpoints.


Start ESB with the following sample configuration:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="">
    <sequence name="main" onError="errorHandler">
                    <!--List of Recipients (static)-->
                            <address uri="http://localhost:9001/services/SimpleStockQuoteService"/>
                            <address uri="http://localhost:9002/services/SimpleStockQuoteService"/>
                            <address uri="http://localhost:9003/services/SimpleStockQuoteService"/>
            <log level="full"/>
    <sequence name="errorHandler">
        <makefault response="true">
            <code xmlns:tns="" value="tns:Receiver"/>
            <reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>

Deploy the SimpleStockQuoteService and start three instances of sample Axis2 server as mentioned in sample 52 Sessionless Load Balancing Between 3 Endpoints.

The above configuration routes a cloned copy of a message to each recipient defined within the static recipient list. To test this, run the StockQuote client to send an out-only message as follows:

Code Block
ant stockquote -Dmode=placeorder -Dtrpurl=http://localhost:8280/

This client sends a request to the SimpleStockQuoteService through the ESB. ESB will create cloned copies of the message and route to the three endpoints mentioned in the configuration. SimpleStockQuoteService prints the details of the placed order. If you examine the console output of each server, you can see that requests are processed by the three servers as follows:

Code Block
Accepted order #1 for : 15738 stocks of IBM at $ 185.51155223506518

Now shutdown MyServer1 and resend the request. You will observe that requests are still processed by MyServer2 and MyServer3.