Load Balancing and Fail-over

The XMLPrintStream supports load balancing and fail-over. Load balancing increases the capacity of the XML Server by sharing the load among a number of replicated XML Servers and making them appear as one large virtual server. Fail-over provides the capability to switch over automatically to a redundant XML Server upon the failure or abnormal termination of the previously active XML Server.

Load balancing and fail-over are implemented in the XMLPrintStream, and XMLServerEndPoint classes. An instance of the XMLServerEndPoint class contains the endpoint details such as server name, port number and a weight between 0 and 1 which dictates the percentage of requests that are directed to this server. The open() method of the XMLPrintStream class can optionally take a list of XMLServerEndPoints as parameter. The connection will be performed to one of these endpoints based on the weight attached to it as well as its availability.

Load balancing and fail-over can also be configured using the curam.xmlserver.host and curam.xmlserver.port properties. The curam.xmlserver.host property specifies the machine names hosting the XML Server as a '/' separated list of host names. For example:

curam.xmlserver.host="server1/server2/server3"

The curam.xmlserver.port property specifies the ports the XML Server is running on as a '/' separated list of entries in the following format: port[#weight], where the part in square brackets is optional and weight is a number between 0 and 1. The weight dictates the percentage of requests that are directed to the particular server and port. For example:

curam.xmlserver.port="1801#0.6/1802#0.2/1803#0.3"

There is a one to one mapping between the servers and ports specified. For example, server1 is running the XML Server on port 1801 and server3 is running the XML Server on port 1803.