7. Clustering and Loadbalancing

balancer

Performs load-balancing between several nodes. Nodes sharing session state may be bundled into a cluster.

Explanation:

May only be used as interceptor in a ServiceProxy.

Can be used in:

serviceProxy, api, stompProxy, swaggerProxy, if, registration, wsStompReassembler, interceptor, bean, internalProxy, transport and soapProxy

Syntax

<serviceProxy port="9000">
  <adminConsole readOnly="[true, false]">
</serviceProxy>

Sample

<serviceProxy port="2000">
   <balancer>
     <xmlSessionIdExtractor namespace="http://chat.predic8.com/"
	   localName="session" />
	  <clusters>
	    <cluster name="Default">
	      <node host="node1.predic8.com" port="8080" />
	      <node host="node2.predic8.com" port="8090" />
	      <node host="node3.predic8.com" port="8100" />
	    <cluster>
	  </clusters>
    <byThreadStrategy maxNumberOfThreadsPerEndpoint="10"
      	retryTimeOnBusy="1000" />
   </balancer>
</serviceProxy>

Attributes

NameRequiredDefaultDescriptionExample
name false Default
Uniquely identifies this Load Balancer, if there is more than one. Used in the web administration interface and lbclient to manage nodes. balancer1
sessionTimeout false 3600000
Time in milliseconds after which sessions time out. (If a session extractor is used.) Default is 1 hour, 0 means never. 600000 (10min)

Child Elements

ElementsDescriptionCardinality
jSessionIdExtractor Sets the strategy used to extract a session ID from incoming HTTP requests. 0..1
xmlSessionIdExtractor Sets the strategy used to extract a session ID from incoming HTTP requests. 0..1
clusters Specifies a list of clusters. 0..*
byThreadStrategy Sets the strategy used to choose the backend nodes. 0..1
faultMonitoringStrategy Sets the strategy used to choose the backend nodes. 0..1
roundRobinStrategy Sets the strategy used to choose the backend nodes. 0..1
nodeOnlineChecker Checks if nodes are still available. Sets them to "DOWN" when not reachable, else sets them back up when they are reachable. 0..1