Book Image

WildFly Configuration, Deployment, and Administration - Second Edition

Book Image

WildFly Configuration, Deployment, and Administration - Second Edition

Overview of this book

Table of Contents (19 chapters)
WildFly Configuration, Deployment, and Administration Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Clustering web applications


Clustering web applications requires the least effort. As we touched upon earlier, all you need to do to switch on clustering in a web application is add the following directive in the web.xml:

<web-app>
    <distributable/>
</web-app>

By default, clustered web applications will use the web cache contained in the Infinispan configuration. You also have the option of setting up a specific cache per deployment unit. This can be achieved by adding the replication-config directive to the jboss-web.xml file and specifying the cache name to use:

<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" name="web.dist" batching...