You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
redisson/redisson-tomcat/README.md

58 lines
3.2 KiB
Markdown

8 years ago
Redis based Tomcat Session Manager
===
8 years ago
8 years ago
Stores session of Apache Tomcat in Redis and allows to distribute requests across a cluster of Tomcat servers. Implements non-sticky session management backed by Redis.
8 years ago
7 years ago
Supports Apache Tomcat 6.x, 7.x, 8.x, 9.x
8 years ago
8 years ago
Advantages
===
8 years ago
Current implementation differs from any other Redis based Tomcat Session Manager in terms of efficient storage and optimized writes. Each session attribute is written into Redis during each `HttpSession.setAttribute` invocation. While other solutions serialize whole session each time.
8 years ago
8 years ago
Usage
===
8 years ago
**1** Add `RedissonSessionManager` into `context.xml`
8 years ago
```xml
<Manager className="org.redisson.tomcat.RedissonSessionManager"
7 years ago
configPath="${catalina.base}/redisson.conf" readMode="MEMORY" updateMode="DEFAULT"/>
8 years ago
```
7 years ago
`readMode` - read attributes mode. Two modes are available:
* `MEMORY` - read attributes stored in local Tomcat Session. Default mode.
* `REDIS` - read directly from Redis.
`updateMode` - attributes update mode. Two modes are available:
* `DEFAULT` - session attributes are stored into Redis only through setAttribute method. Default mode.
* `AFTER_REQUEST` - all session attributes are stored into Redis after each request.
8 years ago
`configPath` - path to Redisson JSON or YAML config. See [configuration wiki page](https://github.com/redisson/redisson/wiki/2.-Configuration) for more details.
8 years ago
8 years ago
**2** Copy two jars into `TOMCAT_BASE/lib` directory:
8 years ago
8 years ago
1. __For JDK 1.8+__
7 years ago
[redisson-all-3.7.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.7.0&e=jar)
8 years ago
for Tomcat 6.x
7 years ago
[redisson-tomcat-6-3.7.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-6&v=3.7.0&e=jar)
8 years ago
for Tomcat 7.x
7 years ago
[redisson-tomcat-7-3.7.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=3.7.0&e=jar)
8 years ago
for Tomcat 8.x
7 years ago
[redisson-tomcat-8-3.7.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=3.7.0&e=jar)
7 years ago
for Tomcat 9.x
7 years ago
[redisson-tomcat-9-3.7.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-9&v=3.7.0&e=jar)
8 years ago
8 years ago
2. __For JDK 1.6+__
7 years ago
[redisson-all-2.12.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=2.12.0&e=jar)
8 years ago
for Tomcat 6.x
7 years ago
[redisson-tomcat-6-2.12.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-6&v=2.12.0&e=jar)
8 years ago
for Tomcat 7.x
7 years ago
[redisson-tomcat-7-2.12.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=2.12.0&e=jar)
7 years ago
for Tomcat 8.x
7 years ago
[redisson-tomcat-8-2.12.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=2.12.0&e=jar)
7 years ago
8 years ago