<?xml version="1.0" encoding="iso-8859-1"?>
<!--
  ~  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~  WSO2 Inc. licenses this file to you under the Apache License,
  ~  Version 2.0 (the "License"); you may not use this file except
  ~  in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing,
  ~  software distributed under the License is distributed on an
  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~  KIND, either express or implied.  See the License for the
  ~  specific language governing permissions and limitations
  ~  under the License.
  ~
  -->
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
  <title>
      WSO2 ESB - Endpoint Catalog
  </title>
  <link href="css/esb-docs.css" rel="stylesheet" />
  <link href="styles/dist-docs.css" rel="stylesheet" type="text/css"
  media="all" />
</head>


<body xml:lang="en">
    [ <a href="docs_index.html"> Documentation Index </a> ]
<h1>WSO2 Enterprise Service Bus (ESB) Endpoint Catalog</h1>
<p>The endpoints catalog wlks you through the endpoints which are there inside the WSO2 ESB.
This will cover the very basics of the endpoints and dive deeper in to the configurtion details and
the technical implementation details as well</p>

    <h2>Contents</h2>
    <ul>
        <li><a href="#Intro">Endpoints - Introduction</a>
            <ul>
                <li><a href="#Jconsole">Using jconsole to manage state transition between states</a></li>
            </ul>
        </li>
        <li><a href="#AddressEp">Address Endpoint</a>
            <ul>
                <li><a href="#AddressEpConfig">Address endpoint configuration</a></li>
                <li><a href="#AddressEpAttr">Address endpoint attributes</a></li>
                <li><a href="#QoSEp">QoS for the endpoint</a></li>
                <li><a href="#QoSConfig">QoS configuration</a></li>
                <li><a href="#EpTimeout">Endpoint timeout</a></li>
                <li><a href="#TimeoutConfig">timeout configuration</a></li>
                <li><a href="#MarkSuspension">Marking endpoint for suspension</a></li>
                <li><a href="#SuspensionConfig">markForSuspension configuration</a></li>
                <li><a href="#SuspendingEp">Suspending endpoint on failure</a></li>
                <li><a href="#SuspendOnFailureConfig">suspendOnFailure configuration</a></li>
                <li><a href="#SampleAddressURI">Following are the sample address URI definitions</a></li>
            </ul>
        </li>
        <li><a href="#DefaultEp">Default Endpoint</a>
            <ul>
                <li><a href="#DefaultEpConfig">Default endpoint configuration</a></li>
            </ul>
        </li>
        <li><a href="#WsdlEp">WSDL endpoint</a>
            <ul>
                <li><a href="#WsdlEpConfig">WSDL endpoint configuration</a></li>
            </ul>
        </li>
        <li><a href="#LbEp">Load balance Endpoint</a>
            <ul>
                <li><a href="#LbEpConfig">Load balance endpoint configuration</a></li>
            </ul>
        </li>
        <li><a href="#FoEp">Failover Endpoint</a>
            <ul>
                <li><a href="#FoEpConfig">Failover endpoint configuration</a></li>
            </ul>
        </li>
        <li><a href="#DlbEp">Dynamic Load balance Endpoint</a>
            <ul>
                <li><a href="#DlbEpConfig">Dynamic Load balance endpoint configuration</a></li>
            </ul>
        </li>
    </ul>
<h2 id="Intro">Endpoints - Introduction</h2>
<p>An endpoint
defines an external destination for an outgoing message through WSO2
ESB. An &lt;endpoint&gt; element defines an endpoint in the
configuration. An endpoint may be specified as an address endpoint, WSDL based endpoint, a load
balancing endpoint or a fail-over endpoint as follows:
</p>

<pre  xml:space="preserve">
    &lt;endpoint [name="string"] [key="string"]&gt;
        address-endpoint | default-endpoint | wsdl-endpoint | load-balanced-endpoint | fail-over-endpoint
    &lt;/endpoint&gt;
</pre>
<p>
All the types of endpoints can have a name attribute which specify the name of the endpoint  and  such named endpoints
    can be referred by other endpoints using a key attribute. For example if there is an endpoint named as "foo",
the following endpoint can be used in any place, where "foo" has to be used.
</p>

<pre  xml:space="preserve">
    &lt;endpoint key="foo"/&gt;
</pre>
<p>This let the users to reuse the already defined endpoints  in several places.</p>
<p>The endpoints also have a trace attribute which turns on detailed trace information for messages being sent to the
    endpoint. These are available in the trace.log configured via the log4j.properties file(which can be found within
    lib folder once you unzip wso2 ESB zip). Setting the trace log level to TRACE will dump detailed trace information
    including message payloads.
</p>
<p>
At any given time an endpoint can be one of the following four states.</p>

<p><b>[1] Active</b> - Endpoint is active and running.</p>
<p><b>[2] TimeOut </b>- The endpoint can be in TimeOut state if
    we get a timeout error when invoking the endpoint (because the endpoint is currently unavailable or due to a
    network failure) or if it returns a previously defined error code for timeout state, the endpoint said to be in
    TimeOut state.  The possible error codes can be found in the <a title="SynapseConstant class"
    href="https://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java"
    id="or6m">SynapseConstant class</a> (under the endpoint failure section). A timed out endpoint is a candidate for a suspenstion.
    The configuration related to marking an endpoint for suspension is given by <b><i>markForSuspension</i></b>.If the configuration
    does have a positive retrieve count (see the configuration section below) the endpoint will be retrieve again
    (the number of time to retrieve can be configured using the same configuration element) and if it fails in further attempts it will transfer
    into <b>Suspended</b> state. </p>
<p><b>[3] Suspended</b> - When invoking the endpoint if a previously defined error code for Suspended state is returned
    or a if a TimeOut endpoint fails in further attempts  the endpoint is said to be in <b>Suspended</b> state.
    The endpoint can goes into Active state once the suspend duration is over.  The configuration section
    called <b><i>suspendOnFailure</i></b>.</p>
<p><b>[4] Switch Off</b> - The endpoint is moved into maintains mode.
</p>

<p>
A state transfer between any state to <b>Switch off</b> state can be done only manually using JMX based API.
    And also an endpoint which is in <b>SwitchOff</b> state can only transfer into <b>Active state</b> again using
    the JMX based API. See section on using JMX based API to learn how to do this.
</p>

<p>
The state transition between states can be shown as follows.
</p>

<div id="endpoint-state" style="text-align: left;"><img style="width: 648px; height: 267.568px;"
                 alt="endpoint-state-image" src="images/endpoint-state.png"/></div>
<p>Figure1: The state transition between states in an endpoint</p>

<h3 id="Jconsole">Using jconsole to manage state transition between states</h3>

<p>The jconsole tool is a JMX-compliant graphical tool for monitoring a Java virtual machine. If you have installed
    java you'll automatically get this tool. We'll add an endpoint (name 'ep1') and monitor the states transition
    between states in ep1
</p>

<p>1. Add an address endpoint called 'ep1'. Refer endpoint userguide to see how this can be done.</p>
<p>2. Start jconsole by typing jconsole at your termnial, if you encounter any problem please consult your operatying
    system guide. You'll see the following console once you select Mbeans tab. </p>

<div id="jconsole" style="text-align: left;"><img style="width: 648px; height: 414.212px;"
               alt="jconsole-mbean-tab" src="images/jconsole-mbean.png"/></div>

<p>Figure2: Jconsole Mbeans tab</p>
<p>3.Go to org.apache.synpase menu from left hand and expand it. You'll see the following figure with the
    endpoint ep1 that we just added.
</p>

<div id="jconsole-endpoint" style="text-align: left;"><img style="width: 648px; height: 560.852px;"
                                alt="endpoint-mbean-show" src="images/endpoint-mbean.png"/></div>
<p>Figure3: Endpoint Mbean is selected </p>

<p>4. Select the ep1 endpoint and you'll see the information related to this endpoint and please note that the state
    is given as active as the first entry and value is set to true. The endpoint is in active state.
</p>
<div id="endpoint-info" style="text-align: left;"><img style="width: 648px; height: 402.848px;"
       alt="endpoint-information-image" src="images/endpoint-info.png"/></div>
<p>Figure4: The ep1 endpoint attributes. The endpoint is active.</p>

<p>5. Now go to the Operations tab and switch off the endpoint. You'll see a message saying the
    operation was successful.
</p>
<div id="endpoin-off" style="text-align: left;"><img
     alt="endpoint-off-image"   style="width: 648px; height: 713.229px;" src="images/endpoint-off.png"/></div>
<p>Figure5: Switching off the endpoint.</p>

<p>You'll also see a INFO level log message saying that the endpoint was switched off manually.</p>

<p><span style="font-family: serif;">[2009-06-23 12:18:21,149] INFO - EndpointContext Manually switching off endpoint : ep1</span></p>

<p>6. Next again switch back to Attributes tab and see the state of the endpoint after refreshing it. You'll see
    endpoint is inactive and the endpoint is in switch off state. At this point if you try to use a client which
    use this endpoint you'll see it fails since the endpoint is down. You can use a similar approach activate the
    endpoint back.
</p>

<div id="y.8h" style="text-align: left;"><img style="width: 648px; height: 336.767px;"
      alt="endpoint-switched-off-image" src="images/endpoint-turn-off.png"/></div>
<p>Figure6: Endpoint is in Switch off state.</p>

<h2 id="AddressEp">Address Endpoint</h2>
<p>Address endpoint is an endpoint defined by specifying the EPR (Endpoint Reference) and other attributes
    of the configuration.</p>

<h3 id="AddressEpConfig">Address endpoint configuration</h3>

<pre xml:space="preserve">
&lt;address uri="<i>endpoint address</i>" [format="soap11|soap12|pox|get"] [optimize="mtom|swa"]
    [encoding="<i>charset encoding</i>"]
    [statistics="enable|disable"] [trace="enable|disable"]&gt;

    &lt;enableRM [policy="<i>key</i>"]/&gt;?
    &lt;enableSec [policy="<i>key</i>"]/&gt;?
    &lt;enableAddressing [version="final|submission"] [separateListener="true|false"]/&gt;?

    &lt;timeout&gt;
        &lt;duration&gt;<i>timeout duration in milliseconds</i>&lt;/duration&gt;
        &lt;action&gt;discard|fault&lt;/action&gt;
    &lt;/timeout&gt;?

    &lt;markForSuspension&gt;
        [&lt;errorCodes&gt;xxx,yyy&lt;/errorCodes&gt;]
        &lt;retriesBeforeSuspension&gt;m&lt;/retriesBeforeSuspension&gt;
        &lt;retryDelay&gt;d&lt;/retryDelay&gt;
    &lt;/markForSuspension&gt;

    &lt;suspendOnFailure&gt;
        [&lt;errorCodes&gt;xxx,yyy&lt;/errorCodes&gt;]
        &lt;initialDuration&gt;n&lt;/initialDuration&gt;
        &lt;progressionFactor&gt;r&lt;/progressionFactor&gt;
        &lt;maximumDuration&gt;l&lt;/maximumDuration&gt;
    &lt;/suspendOnFailure&gt;
&lt;/address&gt;
</pre>

<h3 id="AddressEpAttr">Address endpoint attributes</h3>
<div><table id="grrh" border="1"  cellpadding="3" cellspacing="0"
            width="1488"><tbody>
    <tr><td>uri<br/></td><td>EPR of the target endpoint.
    See the table below for a possible list of transports.<br/></td></tr>
    <tr><td>format<br/></td><td>Message format for the endpoint.<br/></td></tr>
    <tr><td>optimize<br/></td><td>Method to optimize the attachments.<br/></td></tr>
    <tr><td>encoding<br/></td><td>The charset encoding to use for the endpoint.<br/></td></tr>
    <tr><td>statistics<br/></td><td>This enables statistics for the endpoint.<br/></td></tr>
    <tr><td>trace<br/></td><td>This enables trace for the endpoint.<br/></td></tr>
</tbody></table></div>

<h3 id="QoSEp">QoS for the endpoint</h3>
<p>QoS (Quility of service) aspects such as WS-RM(WS-Reliable messaging), WS-Security  and WS-Addressing may be
    enabled on messages send to an endpoint using <b>enableRM, enableSec</b> and <b>enableAddressing</b>
    elements. Optionally, the WS-RM and WS-Security policies could be specified using <i><b>policy</b></i> attribute.
</p>
<h3 id="QoSConfig">QoS configuration</h3>

<div><table id="v1c." border="1"  cellpadding="3" cellspacing="0"  width="1490">
    <tbody>
        <tr><td>enableRM [policy="<i>key</i>"]<br/></td><td>This enables WS-Reliable messaging
            for the message which goes for the endpoint. The optional <i>policy</i> attribute specify the WS-RM
            policy.<br/></td></tr>
        <tr><td>enableSec [policy="<i>key</i>"]<br/></td><td>This enables WS-Security for
            the message which goes for the endpoint. The optional <i>policy</i> attribute specify the WS-Security
            policy.<br/></td></tr>
        <tr><td>enableAddressing [version="final | submission"] [seperateListener=" true | false"]<br/>
        </td><td>This enables WS-Addressing for the message which goes for the endpoint. User can specify
            to have seperate listener with version final or submission. <br/></td></tr>
    </tbody></table></div>

<h3 id="EpTimeout">Endpoint timeout</h3>
<p>Address(and also WSDL) endpoints can timeout if the response fails to arrive at Synapse by a predefined
    timeout duration specified in seconds. The timeout action specifies whether to discard reponse that arives
    later, or to trigger a fault. Synapse has a periodic timeout handler that triggers itself at each 15 seconds
    interval. Thus endpoint timeout will have a +/- erroce on trigger time. Though this can be minimized by
    setting a System property "synapse.timeout_handler_interval"(This property can be set in synapse.properties
    synpase property file which is located in conf directory inside repository once you unzipped WSO2 ESB )
    to a millisecond duration below the   desired endpoint timeout, <b>care must be taken as a lesser value may have a
    higher overhead on the system.</b></p>

<h3 id="TimeoutConfig">timeout configuration</h3>
<div><table id="cs2_" border="1"  cellpadding="3" cellspacing="0"  width="1493">
    <tbody>
        <tr><td>duration<br/></td><td>Timeout duration in millisecond. <br/></td></tr>
        <tr><td>action<br/></td><td>Once a timeout occurs the action to perform, avilable
            options are <i>discard</i> (discard the response which arrives late) or <i>fault</i> (trigger a fault)
        .<br/></td></tr>
    </tbody></table></div>

<h3 id="MarkSuspension">Marking endpoint for suspension</h3>
<p>As described before (see description on Timeout state above) this configuration element describes the configuration
    for a timeout endpoint.
</p>
<h3 id="SuspensionConfig">markForSuspension configuration</h3>
<div><table id="aliw" border="1"  cellpadding="3" cellspacing="0"  width="1496">
    <tbody><tr><td>errorCodes<br/></td><td>A comma separated error code list which can be
        returned by the endpoint. See <a title="SynpaseConstant"
        href="https://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java"
        >SynpaseConstant</a> class for a possible list of error codes. <br/></td></tr>
        <tr><td>retriesBeforeSuspension</td><td>Number of retries before go into suspended
            state.<br/></td></tr>
        <tr><td>retryDelay</td><td>The delay between each try.</td></tr>
    </tbody></table></div>
<h3 id="SuspendingEp">Suspending endpoint on failure</h3>
<p>Leaf endpoints(Address and WSDL) endpoint can be put into suspended state if it is detected as failed. An endpoint that
    fails may be suspended for a specified duration after such a failure, during which new messages will not be
    processed through the endpoint. The amount of time waiting before next attempt follows the following formula.
    <br/>
    <b>next suspension time period = Max (Initial Suspension duration * (progression factor <sup>try count</sup>), Maximum Duration)</b><br/>

    All the variables in the above formula are configuration values used to calculate the try count. Try count means,
    how many tries occurred after the endpoint is SUSPENDED. As the try count increases, the next SUSPENSION time
    period will also increase. This increase is bound to a maximum duration.<br/>
</p>

<h3 id="SuspendOnFailureConfig">suspendOnFailure configuration</h3>
<div>
<table id="ieu9" border="1"  cellpadding="3" cellspacing="0"  width="1499">
<tbody>
<tr>
<td>errorCode<br/>
</td>
<td>A comma separated error code list which can be returned by the endpoint. See <a title="SynpaseConstant"
        href="https://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java"
        >SynpaseConstant</a> class for a possible list of error codes. <br/>
</td>
</tr>
<tr>
<td>
initialDuration
</td>
<td>Initial duration(in milliseconds) to suspend the endpoint.<br/>
</td>
</tr>
<tr>
<td>
progressionFactor
</td>
<td>The progression factor for the geometric series. See above for a more detailed description.<br/>
</td>
</tr>
<tr>
<td>
maximumDuration
</td>
<td>Maximum duration(in milliseconds) to suspend the endpoint. <br/>
</td>
</tr>
</tbody>
</table>
</div>

<h3 id="SampleAddressURI">Following are the sample address URI definitions.</h3>
<div>
<table id="aq95" border="1"  cellpadding="3" cellspacing="0" width="1495">
<tbody>
<tr>
<td>Transport<br/>
</td>
<td>Sample Address<br/>
</td>
</tr>
<tr>
<td>HTTP<br/>
</td>
<td>http://localhost:9000/services/SimpleStockQuoteService</td>
</tr>
<tr>
<td>JMS<br/>
</td>
<td>jms:/SimpleStockQuoteService?<br/>
              transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;<br/>
              java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;<br/>
              java.naming.provider.url=tcp://localhost:61616&amp;<br/>
              transport.jms.DestinationType=topic</td>
</tr>
<tr>
<td>Mail<br/>
</td>
<td>mailto:guest@host</td>
</tr>
<tr>
<td>VFS<br/>
</td>
<td>vfs:file:///home/user/directory<br/>
    vfs:file:///home/user/file<br/>
    vfs:ftp://guest:guest@localhost/directory?vfs.passive=true
</td>
</tr>
<tr>
<td>FIX<br/>
</td>
<td>fix://host:port?BeginString=FIX4.4&amp;SenderCompID=WSO2&amp;TargetCompID=APACHE<br/>
<br/>
</td>
</tr>
</tbody>
</table>
</div>

<h2 id="DefaultEp">Default Endpoint</h2>
<p>Default endpoint is an endpoint defined for adding QoS and other configurations
      to the endpoint which is resolved from the 'To' address of the message context.
      All the configurations such as message format for the endpoint, the method
      to optimize attachments, reliable messaging, security policies for the endpoint
      can be specified as in the Address Endpoint. This endpoint differs from the address
      endpoint only in the uri attribute which will not be present in this endpoint.
      Following section describes the configuration of a default endpoint.</p>
<h3 id="DefaultEpConfig">Default endpoint configuration</h3>
<pre xml:space="preserve">
&lt;default [format="soap11|soap12|pox|get"] [optimize="mtom|swa"]
     [encoding="<i>charset encoding</i>"]
     [statistics="enable|disable"] [trace="enable|disable"]&gt;

    &lt;enableRM [policy="<i>key</i>"]/&gt;?
    &lt;enableSec [policy="<i>key</i>"]/&gt;?
    &lt;enableAddressing [version="final|submission"] [separateListener="true|false"]/&gt;?

    &lt;timeout&gt;
        &lt;duration&gt;<i>timeout duration in milliseconds</i>&lt;/duration&gt;
        &lt;action&gt;discard|fault&lt;/action&gt;
    &lt;/timeout&gt;?

    &lt;markForSuspension&gt;
        [&lt;errorCodes&gt;xxx,yyy&lt;/errorCodes&gt;]
        &lt;retriesBeforeSuspension&gt;m&lt;/retriesBeforeSuspension&gt;
        &lt;retryDelay&gt;d&lt;/retryDelay&gt;
    &lt;/markForSuspension&gt;

    &lt;suspendOnFailure&gt;
        [&lt;errorCodes&gt;xxx,yyy&lt;/errorCodes&gt;]
        &lt;initialDuration&gt;n&lt;/initialDuration&gt;
        &lt;progressionFactor&gt;r&lt;/progressionFactor&gt;
        &lt;maximumDuration&gt;l&lt;/maximumDuration&gt;
    &lt;/suspendOnFailure&gt;
&lt;/default&gt;
</pre>

<h2 id="WsdlEp">WSDL endpoint</h2>
<p>WSDL endpoint is an endpoint definition based on a specified WSDL document. The WSDL document can be specified
    either as a URI or as an inlined definition within the configuration. The service and port name
    containing the target EPR has to be specified with the 'service' and 'port' (or 'endpoint') attributes
    respectively. enableRM, enableSec, enableAddressing, suspendDurationOnFailure and timeout elements are same
    as for an Address endpoint.</p>

<h3 id="WsdlEpConfig">WSDL endpoint configuration</h3>
<pre xml:space="preserve">
&lt;wsdl [uri="wsdl-uri"] service="qname" port/endpoint="qname"&gt;
    &lt;wsdl:definition&gt;...&lt;/wsdl:definition&gt;?
    &lt;wsdl20:description&gt;...&lt;/wsdl20:description&gt;?
    &lt;enableRM [policy="key"]/&gt;?
    &lt;enableSec [policy="key"]/&gt;?
    &lt;enableAddressing/&gt;?

    &lt;timeout&gt;
        &lt;duration&gt;<i>timeout duration in milliseconds</i>&lt;/duration&gt;
        &lt;action&gt;discard|fault&lt;/action&gt;
    &lt;/timeout&gt;?

    &lt;markForSuspension&gt;
        [&lt;errorCodes&gt;xxx,yyy&lt;/errorCodes&gt;]
        &lt;retriesBeforeSuspension&gt;m&lt;/retriesBeforeSuspension&gt;
        &lt;retryDelay&gt;d&lt;/retryDelay&gt;
    &lt;/markForSuspension&gt;

    &lt;suspendOnFailure&gt;
        [&lt;errorCodes&gt;xxx,yyy&lt;/errorCodes&gt;]
        &lt;initialDuration&gt;n&lt;/initialDuration&gt;
        &lt;progressionFactor&gt;r&lt;/progressionFactor&gt;
        &lt;maximumDuration&gt;l&lt;/maximumDuration&gt;
    &lt;/suspendOnFailure&gt;
&lt;/wsdl&gt;
</pre>

<h2 id="LbEp">Load balance Endpoint</h2>
<p>A Load balanced endpoint distributes the messages (load) arriving at it
      among a set of listed endpoints or static members by evaluating the load balancing policy
      and any other relevant parameters. The policy attribute of the load balance
      element specifies the load balance policy (algorithm) to be used for
      selecting the target endpoint or static member. Currently only the roundRobin policy is
      supported. The failover attribute determines if the next endpoint or static member should be
      selected once the currently selected endpoint or static member has failed, and defaults to
      true. The set of endpoints or static members amongst which the load has to be distributed
      can be listed under the 'loadBalance' element. These endpoints can belong to any
      endpoint type mentioned in this document. For example, failover endpoints
      can be listed inside the load balance endpoint to load balance between
      failover groups etc. The loadbalance element cannot have both endpoint &amp; member child
      elements in the same configuration. In the case of the member child element, the <i>hostName</i>,
      <i>httpPort</i> and/or <i>httpsPort</i> attributes could be specified.</p>
  <p>
  The optional 'session' element makes the endpoint a session affinity based
      load balancing endpoint. If it is specified, sessions are bound to
      endpoints in the first message and all successive messages for those
      sessions are directed to their associated endpoints. Currently there are two types
      of sessions supported in SAL endpoints. Namely HTTP transport based session
      which identifies the sessions based on http cookies and the client session which
      identifies the session by looking at a SOAP header sent by the client with the QName
      '{http://ws.apache.org/ns/synapse}ClientID'. The 'failover' attribute mentioned above
      is not applicable for session affinity based endpoints and it is always
      considered as set to false. If it is required to have failover behavior in session
      affinity based load balance endpoints, list failover endpoints as the target endpoints.
  </p>

<h3 id="LbEpConfig">Load balance endpoint configuration</h3>
<pre xml:space="preserve">
&lt;session type="http|simpleClientSession"/&gt;?
&lt;loadBalance [policy="roundRobin"] [algorithm="impl of org.apache.synapse.endpoints.algorithms.LoadbalanceAlgorithm"]
        [failover="true|false"]&gt;
    &lt;endpoint .../&gt;+
    &lt;member hostName="host" [httpPort="port"] [httpsPort="port2"]&gt;+
&lt;/loadBalance&gt;
</pre>


<h2 id="FoEp">Failover Endpoint</h2>
<p>Failover endpoints send messages to the listed endpoints with the following failover behavior. At the start, the
    first listed endpoint is selected as the primary and all other endpoints are treated as backups.
    Incoming messages are always sent only to the primary endpoint. If the primary endpoint fails,
    next active endpoint is selected as the primary and failed endpoint is marked as inactive.
    Thus it sends messages successfully as long as there is at least one active endpoint among the listed
    endpoints.</p>

<h3 id="FoEpConfig">Failover endpoint configuration</h3>
<pre xml:space="preserve">
&lt;failover&gt;
    &lt;endpoint .../&gt;+
&lt;/failover&gt;
</pre>

<h2 id="DlbEp">Dynamic Load balance Endpoint</h2>
<p>A Dynamic Load balanced endpoint distributes the messages (load) arriving at it among a application members by
    evaluating the load balancing policy and any other relevant parameters. These application members will be
    discovered using the membershipHandler class. Generally, this class will use a group communication mechanism
    to discover the application members. The class attribute of the membershipHandler element should be an
    implementation of   org.apache.synapse.core.LoadBalanceMembershipHandler. membershipHandler specific properties
    can be specified using the property elements. The policy attribute of the dynamicLoadbalance element specifies
    the load balance policy (algorithm) to be used for selecting the next member to which the message has to be
    forwaded to. Currently only the roundRobin policy is supported. The failover attribute determines if the next
    member should be selected once the currently selected member has failed, and defaults to true.</p>
<h3 id="DlbEpConfig">Dynamic Load balance endpoint configuration</h3>
<pre xml:space="preserve">
  &lt;dynamicLoadBalance [policy="roundRobin"] [failover="true|false"]&gt;
    &lt;membershipHandler class="impl of org.apache.synapse.core.LoadBalanceMembershipHandler"&gt;
      &lt;property name="name" value="value"/&gt;
    &lt;/membershipHandler&gt;
  &lt;/dynamicLoadBalance&gt;
</pre>

</body>
</html>