Replicating session in JBoss 

In this tutorial, we will see how to do Session replication in Weblogic Cluster

You now need to use the node1 and node2 created before

In session-test.war/WEB-INF/web.xml, add:


  <display-name>Session Test</display-name>


  <distributable/> <!--  -->



Your application’s HTTP sessions now use the distributed cache.

Now :

         Disable sticky sessions (optional)

         Redeploy session-test.war to node1/deploy and node2/deploy directories

         Restart and retest

You can know see that your application is fault tolerant, it supports failover AND state replication

Problems with sticky sessions?

         Uneven distribution of load

         If one instance goes down, all of its sessions go with it

You can configure session replication here:

Sessions are replicated by all/deploy/cluster/jboss-cache-manager.sar:


Caching Configuration: replication queue

Cluster Name and Configuration: communication

Desired to gain proficiency on JBOSS?

Explore the blog post on JBOSS training to become a pro in JBOSS.

         Configure session replication per app in WEB-INF/jboss-web.xml


Replication granularity: SESSION, ATTRIBUTE, FIELD


<deployment ...>


  <bean name="CacheConfigurationRegistry" ...>


    <property name="newConfigurations">

      <map keyClass="java.lang.String" valueClass="org.jboss.cache.config.Configuration">



        <bean name="StandardSessionCacheConfig" class="org.jboss.cache.config.Configuration">


         <property name="clusterName">${}-SessionCache</property>

         <property name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>

         <property name="fetchInMemoryState">true</property>

         <property name="nodeLockingScheme">PESSIMISTIC</property>

         <property name="isolationLevel">REPEATABLE_READ</property>

         <property name="useLockStriping">false</property>

         <property name="cacheMode">REPL_ASYNC</property>

         <property name="syncReplTimeout">17500</property>

         <property name="lockAcquisitionTimeout">15000</property>












You can also specify for each application some parameters:








For indepth understanding on JBoss click on: