Description
1. create Endpoint Template
2. create loadbalance failover config
3. use tempalte endpoints to point to the template
4. run load balance scenario with all backends down
ie:- sample config
<definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="LBProxy" transports="https http" startOnLoad="true">
<target faultSequence="errorHandler">
<inSequence>
<send>
<endpoint>
<session type="simpleClientSession"/>
<loadbalance algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
<endpoint name="templ_ep1" template="endpoint_template" uri="http://localhost:9001/services/LBService1">
<parameter name="suspend_duration" value="50"/>
</endpoint>
<endpoint name="templ_ep2" template="endpoint_template" uri="http://localhost:9002/services/LBService1">
<parameter name="suspend_duration" value="20"/>
</endpoint>
<endpoint name="templ_ep3" template="endpoint_template" uri="http://localhost:9003/services/LBService1">
<parameter name="suspend_duration" value="200"/>
</endpoint>
</loadbalance>
</endpoint>
</send>
<drop/>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_2.wsdl"/>
</proxy>
<sequence name="errorHandler">
<makefault>
<code value="tns:Receiver" xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
<reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
</makefault>
<send/>
</sequence>
<template name="endpoint_template">
<parameter name="suspend_duration"/>
<endpoint name="$name">
<address uri="$uri">
<enableAddressing/>
<suspendDurationOnFailure>$suspend_duration</suspendDurationOnFailure>
</address>
</endpoint>
</template>
</definitions>