Sun Java System Application Server employs a randomization and round-robin algorithm for load balancing of remote EJB references and name service objects on the RMI-IIOP path.
When an RMI-IIOP client first creates a new InitialContext
object, the list of available Application Server IIOP endpoints is randomized for that client. For that InitialContext
object, the load balancer directs lookup requests and other InitialContext
operations to the first endpoint on the list. If the first endpoint is not available then the second endpoint in the list is used, and so on.
Each time the client subsequently creates a new InitialContext
object, the endpoint list is rotated so that a different IIOP endpoint is used for InitialContext
operations.
When you obtain or create beans from references obtained by an InitialContext
object, those beans are created on the Application Server instance serving the IIOP endpoint assigned to the InitialContext
object. The references to those beans contain the IIOP endpoint addresses of all Application Server instances in the cluster.
The primary endpoint is the bean endpoint corresponding to the InitialContext
endpoint used to look up or create the bean. The other IIOP endpoints in the cluster are designated as alternate endpoints. If the bean's primary endpoint becomes unavailable, further requests on that bean fail over to one of the alternate endpoints.
See Also: