## Apache Synapse

## Sample 61: Routing message to 3 static recipients

<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>

### Objective

Objective: Routing message to 3 static recipients

### Pre-requisites

- Start ESB with sample configuration 61. (i.e. wso2esb-samples -sn 61)
- Start three instances of the sample Axis2 server on HTTP ports 9001, 9002 and 9003 and give unique names to each server. For instructions on starting the Axis2 server, see Starting the Axis2 server

### Executing the Client

Invoke the sample client as follows

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

Back to Catalog