Session replication configuration for nsasj, Infinispan subsystem in domain.xml – HP Integrity NonStop H-Series User Manual

Page 60

Advertising
background image

store as illustrated in

Figure 2 (page 14)

. In NSASJ, the embedded caches are in local mode and

do not share any data. Instead, when the clustered session information is put into the cache, it is
evicted to the remote backup store in the Infinispan Cache servers. Session data requests are
obtained by querying the remote backup store in Infinispan Cache servers. Thus, when requests
span across instances of NSASJ, the most recent data is obtained from the remote store. Also, the
remote store Infinispan Cache servers are configured to form a cluster, and are in distributed mode
to avoid any single point of failure.

Session replication configuration for NSASJ

For an application to have session replication on failover, the application must be distributable.
The following section describes the way to achieve session replication:

Indicate that the application is distributable. If the application is marked as distributable, the session
details are stored in the cache. To achieve this, add the <distributable/> element inside the
<web-app> tag of the application's web.xml file. The following example depicts the only
configuration change in the application:

Example 2 Sample snippet

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="

http://java.sun.com/xml/ns/j2ee

" xmlns:xsi=

http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation="

http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd

">

<distributable/>
</web-app>

The default configuration given with NSASJ takes care of session replication.

Infinispan subsystem in domain.xml

The following snippet is a sample depicting the default configuration for session replication:

<subsystem xmlns="urn:jboss:domain:infinispan:1.3">
<cache-container name="web" aliases="standard-session-cache" default-cache="web-local"
module="org.jboss.as.clustering.web.infinispan">
<local-cache name="web-local" batching="true" start="EAGER">
<remote-store cache="remote-web" socket-timeout="40000" tcp-no-delay="true" shared="true" preload="true"
passivation="false" fetch-state="false" purge="false">
<remote-server outbound-socket-binding="remote-store-hotrod-server"/>
</remote-store>

Table 15 Components of domain.xml

Description

Attribute

Element

For session replication, NSASJ looks for a cache container
by name web.

name

cache container

The alias has to be standard-session-cache as NSASJ
looks for cache with the alias for session replication.

alias

Can be any local cache defined in the subsystem.

default-cache

The module used for session replication and has to be
org.jboss.as.clustering.web.infinispan

.

module

The embedded cache in NSASJ is a local cache and acts
as a cache loader.

name

local-cache

This value has to be set to true.

batching

This cache must be started on server startup.

start

The named cache in Infinispan Cache server that acts as
the backup store cache and stores the session information.

cache

remote-store

The timeout value to wait for socket connections to the
Infinispan Cache server.

socket-timeout

60

Configuring NSASJ

Advertising
This manual is related to the following products: