Versions Compared

Key

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

...

Code Block
languagehtml/xml
linenumberstrue
<definitions xmlns="http://ws.apache.org/ns/synapse">
       <sequence name="main" onError="errorHandler">
               <in>
                       <send>
                <endpoint>
                    <loadbalance>
                        <endpoint>
                           
                <endpoint>
                    <loadbalance>
                        <endpoint>
                            <address uri="http://localhost:9001/services/LBService1">
                                                               <enableAddressing/>
                               
                                <suspendDurationOnFailure>60</suspendDurationOnFailure>
                           
                            </address>
                       
                        </endpoint>
                        <endpoint>
                                                   <endpoint>
                            <address uri="http://localhost:9002/services/LBService1">
                               
                                <enableAddressing/>
                               
                                <suspendDurationOnFailure>60</suspendDurationOnFailure>
                           
                            </address>
                       
                        </endpoint>
                        <endpoint>
                           
                        <endpoint>
                            <address uri="http://localhost:9003/services/LBService1">
                                                               <enableAddressing/>
                               
                                <suspendDurationOnFailure>60</suspendDurationOnFailure>
                           
                            </address>
                       
                        </endpoint>
                   
                    </loadbalance>
               
                </endpoint>
           
            </send>
           
            <drop/>
       
        </in>
               <out>
                       <!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
                       <send/>
               </out>
       </sequence>
       <sequence name="errorHandler">
        <makefault response="true">
           
        <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>
       
        <header name="To" action="remove"/>
        <property name="RESPONSE" value="true"/>
        <send/>
       </sequence>
</definitions>

Deploy the LoadbalanceFailoverService by switching to <Synapse installation directory>/samples/axis2Server/src/LoadbalanceFailoverService directory and running ant.
Start three instances of sample Axis2 server on HTTP ports 9001, 9002 and 9003 and give some unique names to each server.

...