WildFly Infinispan HTTP Session Replication Configuration

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

WildFly has built-in support to replicate/distribute session data amongst the cluster nodes, via the pre-configured cache container "web".

<subsystem xmlns="urn:jboss:domain:infinispan:1.5">
    ...
    <cache-container name="web" aliases="standard-session-cache" default-cache="repl" module="org.jboss.as.clustering.web.infinispan">
        <transport lock-timeout="60000"/>
        <replicated-cache name="repl" mode="ASYNC" batching="true">
            <file-store/>
        </replicated-cache>
        <replicated-cache name="sso" mode="SYNC" batching="true"/>
        <distributed-cache name="dist" mode="ASYNC" batching="true" l1-lifespan="0">
            <file-store/>
        </distributed-cache>
    </cache-container>
   ...
</subsystem>

The default HTTP session replication cache, if not configured otherwise, is "web.repl".

It is possible to use an external cache to cluster the session, see Using JDG as External Cache Container for WildFly HTTP Session Replication below.

For more details on HTTP session replication configuration at application level, see:

HTTP Session Replication - cache-name
HTTP Session Replication - replication-mode

HTTP Session-Specific Cache Configuration Considerations

Eviction must not be configured on the HTTP session cache.

Expiration must not be configured on the HTTP session cache.

The web subsystem handles these aspects internally.

The pre-configured "repl" and "sso" caches are there as an example, they're not needed.

Using JDG as External Cache Container for WildFly HTTP Session Replication

Using JDG as External Cache Container for WildFly HTTP Session Replication

TODO

  • Why does “batch” added to the Infinispan configuration gets JDG-based HTTP session storage working?