Distributed session management for Tomcat 8.0: HotRod integration

Provides, via submodules, a base configuration for JBoss project builds, as well as a derived configuration supporting multi-release JARs

License

License

Categories

Categories

Tomcat Container Application Servers WildFly
GroupId

GroupId

org.wildfly.clustering
ArtifactId

ArtifactId

wildfly-clustering-tomcat-8.0-hotrod
Last Version

Last Version

11.0.3.Final
Release Date

Release Date

Type

Type

jar
Description

Description

Distributed session management for Tomcat 8.0: HotRod integration
Provides, via submodules, a base configuration for JBoss project builds, as well as a derived configuration supporting multi-release JARs
Project Organization

Project Organization

JBoss by Red Hat

Download wildfly-clustering-tomcat-8.0-hotrod

How to add to project

<!-- https://jarcasting.com/artifacts/org.wildfly.clustering/wildfly-clustering-tomcat-8.0-hotrod/ -->
<dependency>
    <groupId>org.wildfly.clustering</groupId>
    <artifactId>wildfly-clustering-tomcat-8.0-hotrod</artifactId>
    <version>11.0.3.Final</version>
</dependency>
// https://jarcasting.com/artifacts/org.wildfly.clustering/wildfly-clustering-tomcat-8.0-hotrod/
implementation 'org.wildfly.clustering:wildfly-clustering-tomcat-8.0-hotrod:11.0.3.Final'
// https://jarcasting.com/artifacts/org.wildfly.clustering/wildfly-clustering-tomcat-8.0-hotrod/
implementation ("org.wildfly.clustering:wildfly-clustering-tomcat-8.0-hotrod:11.0.3.Final")
'org.wildfly.clustering:wildfly-clustering-tomcat-8.0-hotrod:jar:11.0.3.Final'
<dependency org="org.wildfly.clustering" name="wildfly-clustering-tomcat-8.0-hotrod" rev="11.0.3.Final">
  <artifact name="wildfly-clustering-tomcat-8.0-hotrod" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.wildfly.clustering', module='wildfly-clustering-tomcat-8.0-hotrod', version='11.0.3.Final')
)
libraryDependencies += "org.wildfly.clustering" % "wildfly-clustering-tomcat-8.0-hotrod" % "11.0.3.Final"
[org.wildfly.clustering/wildfly-clustering-tomcat-8.0-hotrod "11.0.3.Final"]

Dependencies

compile (4)

Group / Artifact Type Version
org.wildfly.clustering : wildfly-clustering-tomcat-8.0-catalina jar 11.0.3.Final
org.infinispan : infinispan-client-hotrod jar 11.0.8.Final
org.wildfly : wildfly-clustering-infinispan-marshalling jar 21.0.2.Final
org.wildfly : wildfly-clustering-web-hotrod jar 21.0.2.Final

provided (1)

Group / Artifact Type Version
org.apache.tomcat : tomcat-catalina jar 8.0.53

test (6)

Group / Artifact Type Version
org.wildfly.clustering : wildfly-clustering-tomcat-common test-jar 11.0.3.Final
org.apache.httpcomponents : httpclient jar 4.5.13
org.infinispan : infinispan-server-testdriver-junit4 jar 11.0.8.Final
org.jboss.arquillian.container : arquillian-tomcat-managed-8 jar 1.1.0.Final
org.jboss.arquillian.junit : arquillian-junit-container jar
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

wildfly-clustering-tomcat

A high-availability session manager for Tomcat based on WildFly's distributed session management and Infinispan server.

Building

  1. Clone this repository and build using Java 8 and a standard maven build.

    $ git clone [email protected]:wildfly-clustering/wildfly-clustering-tomcat.git
    $ cd wildfly-clustering-tomcat
    $ mvn clean install
    

Installation

  1. Enter directory of target Tomcat version and session manager implementation:

    $ cd 9.0/hotrod
    
  2. Copy maven artifact to Tomcat's lib directory:

    $ mvn dependency:copy -DoutputDirectory=$CATALINA_HOME/lib
    
  3. Copy runtime dependencies to Tomcat's lib directory:

    $ mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=$CATALINA_HOME/lib
    

Configuration

Define the distributed Manager implementation either within the global $CATALINA_HOME/conf/context.xml, or within the /WEB-INF/context.xml of a web application:

<Manager className="org.wildfly.clustering.tomcat.hotrod.HotRodManager"/>

Configuration Properties

Implementation specific properties

Property Description
uri Defines a HotRod URI, which includes a list of infinispan server instances and any authentication details. For details, see: https://infinispan.org/blog/2020/05/26/hotrod-uri/
template Defines the server-side configuration template from which a deployment cache is created on the server. Default is org.infinispan.DIST_SYNC.
granularity Defines how a session is mapped to entries in the cache. "SESSION" will store all attributes of a session in a single cache entry. "ATTRIBUTE" will store each session attribute in a separate cache entry. Default is "SESSION".
maxActiveSessions Defines the maximum number of sessions to retain in the near cache. Default is limitless. A value of 0 will disable the near cache.
marshaller Specifies the marshaller used to serialize and deserialize session attributes. Supported marshallers include: JAVA, JBOSS, PROTOSTREAM. Default marshaller is "JBOSS".

HotRod properties

These are configured without their "infinispan.client.hotrod." prefix:

https://github.com/infinispan/infinispan/blob/11.0.x/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/ConfigurationProperties.java

Common Manager properties

https://tomcat.apache.org/tomcat-9.0-doc/config/cluster-manager.html#Common_Attributes

Example

<Manager className="org.wildfly.clustering.tomcat.hotrod.HotRodManager"
         uri="hotrod://127.0.0.1:11222"
         template="transactional"
         granularity="ATTRIBUTE"
         marshaller="PROTOSTREAM"
         maxActiveSessions="100"
         tcp_keep_alive="true"/>
org.wildfly.clustering

WildFly Clustering

WildFly Clustering related projects

Versions

Version
11.0.3.Final
11.0.2.Final
11.0.1.Final
11.0.0.Final
10.0.0.Final
10.0.0.Beta1
9.1.0.Final
9.0.0.Final
8.0.0.Final
7.0.0.Final
6.0.0.Final
5.0.0.Final
4.0.0.Final
3.0.0.Final
2.0.0.Final
1.0.0.Final
1.0.0.CR1
1.0.0.Beta1
1.0.0.Alpha1