Versions Compared

Key

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

...

Expand
titleThe Synapse configurations of the artifacts
Tip

When you unzip the ZIP file you download below in Step 6 when simulating the sample scenario, you can find the below configurations in the <UNZIPPED_FILE>/src/main/synapse-config directory. For more information about these artifacts, go to WSO2 EI Documentation.

Localtabgroup
Localtab
titleProxy Service
Code Block
languagexml
<proxy xmlns="http://ws.apache.org/ns/synapse" name="PointToPointProxy" transports="http https" startOnLoad="true" >
       <target>
           <inSequence>
               <send>
                   <endpoint>
                       <!-- Channel With Multiple Endpoints Load Balancer Will Ensure that only one will receive it -->
                       <loadbalance>
                           <endpoint>
                               <address uri="http://localhost:9000/services/SimpleStockQuoteService/" />
                           </endpoint>
                           <endpoint>
                               <address uri="http://localhost:9001/services/SimpleStockQuoteService/" />
                           </endpoint>
                           <endpoint>
                               <address uri="http://localhost:9002/services/SimpleStockQuoteService/" />
                           </endpoint>
                       </loadbalance>
                   </endpoint>
               </send>
           </inSequence>
           <outSequence>
               <respond/>
           </outSequence>
       </target>
   </proxy>

Simulating the sample scenario 

Follow the below instructions to simulate this sample scenario.

...

Code Block
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
   <soapenv:Header />
   <soapenv:Body>
        <ser:getQuote>        
         <ser:request>
             <ser:symbol>foo</ser:symbol>
         </ser:request>      
      </ser:getQuote>
   </soapenv:Body>
</soapenv:Envelope>

Analyzing the output

Out of the three instances of the Stock Quote service (Axis2 server), only one server acquires the sent request at a given time. When you execute the request, the ESB profile first receives the message and then routes it to the back-end service (StockQuoteService). The following output will be printed on the Axis2 Server Console: 

...