Chapter 13. Clustering JBoss AS services

 

This chapter covers

  • HTTP load balancing
  • HTTP session replication
  • Clustering session EJBs
  • Clustering entities
  • High-availability JNDI

In chapter 12, you learned about the basic concepts of clustering, experimented with a simple cluster, and learned how to configure the underlying tools that enable clustering in JBoss, such as JGroups and JBoss Cache. In this chapter, we build on top of what you learned in chapter 12 to show you how clustering applies to specific Java EE components and technologies. We explore how JBoss Cache can be used to provide state replication for web applications, SFSBs, and the Hibernate entity cache. You learn how load balancing can be enabled through an upstream hardware or software load balancer for web applications, and via dynamic proxies for EJBs. We also look at JBoss’s high-availability JNDI service and see how JNDI lookups can be load balanced across a replicated JNDI cluster.

Table 13.1 lists the various Java EE application components and the clustering requirements they have.

Table 13.1. The clustering requirements for various Java EE components

Object/Component

Requires load balancing?

Requires state replication?

Servlet/JSP

Yes

Yes

EJB SLSB

Yes

No

EJB SFSB

Yes[a]

Yes

EJB Entity

No[b]

Yes[c]

EJB MDB

Yes

No

JNDI object

Yes

Yes

a You must have sticky-session load balancing.

b EJB 2.x Entity Beans could be called remotely, but in EJB3, they can't.

c If you're using Hibernate's 2nd level cache.

13.1. HTTP load balancing

13.2. HTTP session replication

13.3. Clustering session beans

13.4. Clustering entities

13.5. Clustering JNDI

13.6. Summary

13.7. References