Clustering session beans

In Chapter 3, Configuring Enterprise Services, we discussed the difference between Stateless Session Beans (SLSBs), Stateful Session Beans (SFSBs), and Singleton Session Beans.

SLSBs are not able to retain state between invocations, so the main benefit of clustering an SLSB is to balance the load between an array of servers:

@Stateless
@Clustered
public class ClusteredBean {
   public void doSomething() {
   // Do something
   }
}

If you want to further specialize your SLSB, then you can choose the load-balancing algorithm used to distribute the load between your EJBs. The following are the available load-balancing policies for your SLSB:

Load-balancing policy

Description

RoundRobin

It is the default load-balancing policy. The ...

Get WildFly Configuration, Deployment, and Administration - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.