Versions Compared

Key

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

This section explains, through an example scenario, how the Message Dispatcher EIP can be implemented using WSO2 ESB. The following topics are covered:

Table of Contents

...

Simulating the sample scenario

Repeatedly send several requests to the ESB using the Stock Quote client as follows:

ant stockquote -Dtrpurl=http://localhost:8280/ -Dsymbol=Foofoo

Following is the request sent by the Stock Quote client in this example:

Code Block
languagehtml/xml
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
   <soapenv:Header />
   <soapenv:Body>
        <ser:getQuote>        
         <ser:request>
             <ser:symbol>Foo<symbol>foo</ser:symbol>
         </ser:request>      
      </ser:getQuote>
   </soapenv:Body>
</soapenv:Envelope>

...

Let's investigate the elements of the ESB configuration in detail. The line numbers below refer to the ESB configuration shown above.

  • endpoint [line 13 in ESB config] - Defines the endpoint where the request should be sent. 
  • loadbalance [line 14 in ESB config] - Defines a set of endpoints where incoming requests are distributed using a particular algorithm. In this example, the algorithm distributes messages in a weighted round-robin manner.