Group Discounts available for 3+ students and Corporate Clients

Session replication in Weblogic Cluster

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:

<web-app>

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

  <description>…</description>

  <distributable/> <!–  –>

  …

</web-app>

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:

Cache Mode: REPL_SYNC, REPL_ASYNC

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 trigger: SET, SET_AND_GET, SET_AND_NON_PRIMITIVE_GET, ACCESS

Replication granularity: SESSION, ATTRIBUTE, FIELD

deploy/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml:

<deployment …>

  …

  <bean name=”CacheConfigurationRegistry” …>

    …

    <property name=”newConfigurations”>

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

      <entry><key>standard-session-cache</key>

        <value>

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

         …

         <property name=”clusterName”>${jboss.partition.name:DefaultPartition}-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>

         …

       </bean>

       </value>

     </entry>

     …

     </map>

   </property>

   …

  </bean>

  …

</deployment>

You can also specify for each application some parameters:

WEB-INF/jboss-web.xml:

<jboss-web>

  <replication-config>

    <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>

    <replication-granularity>SESSION</replication-granularity>

  </replication-config>

</jboss-web>

For indepth understanding on JBoss click on:

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Session replication in Weblogic Cluster"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Support


    Please Enter Your Details and Query.
    Three + 6