Load balancing and failover
XMLPrintStream supports load balancing and failover. Load balancing increases the capacity of the XML server by sharing the load among a number of replicated XML servers by making them appear as one large virtual server.
Using XMLPrintStream and XMLServerEndPoint classes to load balance
Load balancing and failover are configured 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, 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 secure connection is
made to one of these endpoints based on the weight that is attached to it and its availability.
Using curam.xmlserver.host and curam.xmlserver.port properties to load balance
Load balancing and failover can also be configured by using the curam.xmlserver.host and curam.xmlserver.port properties. The curam.xmlserver.host property specifies the names of the servers that host 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 in the range 0 - 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.