Clustering web applications requires the least effort for the developer. As we have just discussed, all you need to switch on clustering in a web application is adding the following directive in the web.xml
descriptor:
<web-app>
<distributable/>
</web-app>
By default, clustered web applications will use the web cache contained in the Infinispan configuration. One thing you can customize is setting up a specific cache per deployment unit. This can be achieved by adding to jboss-web.xml
the replication-config
directive containing the cache name to be used:
<jboss-web>
<replication-config>
<cache-name>web.dist</cache-name>
</replication-config>
</jboss-web>
The previous configuration should obviously reference a cache defined in the main configuration file:
<cache-container name="web" default-cache="repl"> <alias>standard-session-cache</alias> <distributed-cache mode="ASYNC"...