All docs This doc
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Objective: Demonstrate message routing to a set of dynamic endpoints

Prerequisites

Start ESB with the following sample configuration:

<definitions xmlns="http://ws.apache.org/ns/synapse">
   <sequence name="errorHandler">
      <makefault response="true">
         <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver" />
         <reason value="COULDN'T SEND THE MESSAGE TO THE SERVER." />
      </makefault>
      <send />
   </sequence>
   <sequence name="fault">
      <log level="full">
         <property name="MESSAGE" value="Executing default &quot;fault&quot; sequence" />
         <property name="ERROR_CODE" expression="get-property('ERROR_CODE')" />
         <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')" />
      </log>
      <drop />
   </sequence>
   <sequence name="main" onError="errorHandler">
      <in>
         <property name="EP_LIST" value="http://localhost:9001/services/SimpleStockQuoteService,http://localhost:9002/services/SimpleStockQuoteService,http://localhost:9003/services/SimpleStockQuoteService"/>	
         <property name="OUT_ONLY" value="true" />
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" />
         <send>
            <endpoint>
               <recipientlist>
                  <endpoints value="{get-property('EP_LIST')}" max-cache="20" />
               </recipientlist>
            </endpoint>
         </send>
         <drop/>
      </in>
   </sequence>
</definitions>

You are required to replace ESB_Home with the actual folder name of the ESB home.

 

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

To test this, run the stockquote client to send an out-only message as follows:

ant stockquote -Dmode=placeorder -Dtrpurl=http://localhost:8280/
  • No labels