This is the latest release in the 6.x.x family. For EI 7.0.0, click here.

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

The Load-balanced Group distributes the messages (load) arriving at it among a set of listed endpoints or static members by evaluating the load balancing policy and other relevant parameters.

XML Configuration

The syntax of the load balance endpoint is as follows.

<session type="http|simpleClientSession"/>?
<loadBalance [policy="roundRobin"] [algorithm="impl of org.apache.synapse.endpoints.algorithms.LoadbalanceAlgorithm"]
    <endpoint .../>+
    <member hostName="host" [httpPort="port"] [httpsPort="port2"]>+

The Load-balance attributes and elements:

  • 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 loadBalance element cannot have both endpoint and member child elements in the same configuration. In the case of the member child element, the hostName, httpPort and/or httpsPort attributes could be specified.

  • 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 "[]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.


The parameters available to configure a load-balance endpoint are as follows.

Parameter NameDescription
Endpoint NameThis parameter is used to enter a unique name for the endpoint.
AlgorithmThe algorithm on which the load balancing is based. Round Robin is the default algorithm. You can also load a custom algorithm. Instructions for creating a custom algorithm are included in this article.
Session Management

A session management method from the load balancing group. The possible values are as follows.

  • None - If this is selected, session management is not used.
  • Transport - If this is selected, session management is done on the transport level using HTTP cookies.
  • SOAP - If this is selected, session management is done using SOAP sessions.
  • Client ID - If this is selected, session management is done using an ID sent by the client.
Session Timeout (Mills)The number of milliseconds after which the session would time out.
Add ChildClick this link to add a child endpoint. The required endpoint type can be selected from the list and a section displaying parameters relevant to the selected endpoint type will appear. You can add as many endpoints as required to the load-balance group. See the details of child endpoints in Address Endpoint WSDL Endpoint , and Configuring Failover Endpoints .
Add PropertyClick this link to add properties to the load-balance endpoint. See Properties Reference for details of the available properties.
  • No labels