Merge remote-tracking branch 'origin/master' into mob/track-max-permits

pull/4719/head
maddie-boisvert 2 years ago
commit 61d1b8a85e

@ -3,6 +3,29 @@ Redisson Releases History
Try __[Redisson PRO](https://redisson.pro)__ with **ultra-fast performance** and **support by SLA**.
### 16-Dec-2022 - 3.19.0 released
Feature - implementation of Spring Cache methods added in Spring 5.2
Feature - `entriesRead` and `lag` fields added to `StreamGroup` object
Feature - added [RFencedLock](https://github.com/redisson/redisson/wiki/8.-distributed-locks-and-synchronizers/#810-fenced-lock) implementation
Feature - [credentialsResolver](https://github.com/redisson/redisson/wiki/2.-Configuration#credentialsresolver) setting added
__Breaking change - default codec changed to Kryo5Codec__
Fixed - new Redis node isn't discovered between PubSub subscription attempts
Fixed - `codec`,`nettyHook`,`addressResolverGroupFactory`,`connectionListener` settings can't be defined through Micronaut config
Fixed - evictions metrics doesn't work for RedissonCache (thanks @Nicola Dardanis)
Fixed - PubSub connection isn't reused if it reached subscriptions limit before unsubscribe operation
Fixed - PubSub connection returns to connection pool only if subscriptions limit was reached
Fixed - use slf4j late-binding when logging instead of string concat (thanks @vatarasov)
Fixed - most of pubsub subscriptions fail to resubscribe after failover
Fixed - `RBatch` with `executionMode = REDIS_WRITE_ATOMIC` throws NPE in case of connection starvation
Fixed - `CommandDecoder.messageDecoder()` method throws NPE if `RBatch` object used with `executionMode = IN_MEMORY` (regression since 3.18.1)
Fixed - some scheduled tasks aren't executed (regression since 3.17.5)
Fixed - `RFunction` doesn't pass keys to Redis correctly (thanks @@jordanrmerrick)
Fixed - incorrectly reset jackson type factory (thanks @noelvo)
Fixed - cluster partitions parsing error isn't logged
### 30-Nov-2022 - 3.18.1 released
Feature - Spring Data Redis 3.0.0 module added

@ -7,22 +7,23 @@
Based on high-performance async and lock-free Java Redis client and [Netty](http://netty.io) framework.
Supported JDK: 1.8 ... 19 and Android
Supported Redis: 3.0 ... 7.0
Supported Redis: 3.0 ... 7.0
## Features
* Redis Replicated setup (also compatible with [AWS ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.html) and [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/))
* Redis Cluster setup (also compatible with [AWS ElastiCache Cluster](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Clusters.html), [Amazon MemoryDB](https://aws.amazon.com/memorydb) and [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/))
* Redis Sentinel setup
* Redis with Master with Slave only
* Redis Single (also compatible with [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/) and [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis/))
* Thread-safe implementation
* Supports [Redis Replicated](https://github.com/redisson/redisson/wiki/2.-Configuration/#25-replicated-mode), [Redis Cluster](https://github.com/redisson/redisson/wiki/2.-Configuration/#24-cluster-mode), [Redis Sentinel](https://github.com/redisson/redisson/wiki/2.-Configuration/#27-sentinel-mode), [Redis Master and Slaves](https://github.com/redisson/redisson/wiki/2.-Configuration/#28-master-slave-mode), [Redis Single](https://github.com/redisson/redisson/wiki/2.-Configuration/#26-single-instance-mode) setup
* Supports [AWS ElastiCache](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/WhatIs.html), [Amazon MemoryDB](https://aws.amazon.com/memorydb), [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/), [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis/), [Redis Enterprise](https://redis.com/redis-enterprise/), [Aiven for Redis](https://aiven.io/redis)
* Supports auto-reconnection
* Supports failed to send command auto-retry
* Supports OSGi
* Supports SSL
* Asynchronous connection pool
* Lua scripting
* [JSON datatype](https://github.com/redisson/redisson/wiki/6.-distributed-objects/#615-json-object-holder)
* [Reactive Streams](https://github.com/redisson/redisson/wiki/3.-operations-execution#32-reactive-way) API
* [RxJava3](https://github.com/redisson/redisson/wiki/3.-operations-execution#32-reactive-way) API
* [Asynchronous](https://github.com/redisson/redisson/wiki/3.-operations-execution#31-async-way) API
* Asynchronous connection pool
* Lua scripting
* Local cache support including [Caffeine](https://github.com/ben-manes/caffeine)-based implementation
* [Distributed Java objects](https://github.com/redisson/redisson/wiki/6.-Distributed-objects)
Object holder, Binary stream holder, Geospatial holder, BitSet, AtomicLong, AtomicDouble, PublishSubscribe,
@ -47,13 +48,8 @@ Supported Redis: 3.0 ... 7.0
* [Tomcat Session Manager](https://github.com/redisson/redisson/tree/master/redisson-tomcat) implementation
* [Spring Session](https://github.com/redisson/redisson/wiki/14.-Integration-with-frameworks/#147-spring-session) implementation
* [Redis pipelining](https://github.com/redisson/redisson/wiki/10.-additional-features#103-execution-batches-of-commands) (command batches)
* Supports Android platform
* Supports auto-reconnection
* Supports failed to send command auto-retry
* Supports OSGi
* Supports SSL
* Supports many popular codecs ([JBoss Marshalling](https://github.com/jboss-remoting/jboss-marshalling), [Jackson JSON](https://github.com/FasterXML/jackson), [Avro](http://avro.apache.org/), [Smile](http://wiki.fasterxml.com/SmileFormatSpec), [CBOR](http://cbor.io/), [MsgPack](http://msgpack.org/), [Kryo](https://github.com/EsotericSoftware/kryo), [Amazon Ion](https://amzn.github.io/ion-docs/), [LZ4](https://github.com/jpountz/lz4-java), [Snappy](https://github.com/xerial/snappy-java) and JDK Serialization)
* With over 2000 unit tests
* Over 1800 unit tests
<!--
Used by
================================
@ -106,14 +102,14 @@ Used by
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
#### Gradle
compile 'org.redisson:redisson:3.18.1'
compile 'org.redisson:redisson:3.19.0'
#### SBT
libraryDependencies += "org.redisson" % "redisson" % "3.18.1"
libraryDependencies += "org.redisson" % "redisson" % "3.19.0"
#### Java
@ -171,8 +167,8 @@ Try __[Redisson PRO](https://redisson.pro)__ with **ultra-fast performance** and
## Downloads
[Redisson 3.18.1](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson&v=3.18.1&e=jar),
[Redisson node 3.18.1](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.18.1&e=jar)
[Redisson 3.19.0](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson&v=3.19.0&e=jar),
[Redisson node 3.19.0](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.19.0&e=jar)
## FAQs

@ -3,7 +3,7 @@
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Redisson</name>
@ -172,10 +172,17 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.17.6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.85.Final</version>
<version>4.1.86.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -2,7 +2,6 @@
"resources":{
"includes":[
{"pattern":"\\QMETA-INF/MANIFEST.MF\\E"},
{"pattern":"\\QMETA-INF/services/org.jboss.marshalling.ProviderDescriptor\\E"}
]},
"bundles":[]
}

@ -2,7 +2,7 @@
Integrates Redisson with [Helidon](https://helidon.io/) framework.
Supports Helidon 1.4.x - 3.0.x
Supports Helidon 1.4.x - 3.x.x
## Usage
@ -17,7 +17,7 @@ Maven
<artifactId>redisson-helidon-20</artifactId>
<!-- for Helidon v3.0.x -->
<artifactId>redisson-helidon-30</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
@ -25,9 +25,9 @@ Gradle
```groovy
// for Helidon v1.4.x - v2.5.x
compile 'org.redisson:redisson-helidon-20:3.18.1'
// for Helidon v3.0.x
compile 'org.redisson:redisson-helidon-30:3.18.1'
compile 'org.redisson:redisson-helidon-20:3.19.0'
// for Helidon v3.x.x
compile 'org.redisson:redisson-helidon-30:3.19.0'
```
### 2. Add settings into `META-INF/microprofile-config.properties` file

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-helidon</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-helidon</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -82,7 +82,7 @@
<dependency>
<groupId>io.helidon.microprofile.config</groupId>
<artifactId>helidon-microprofile-config</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
@ -90,14 +90,14 @@
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.cdi</groupId>
<artifactId>helidon-microprofile-cdi</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>

@ -40,7 +40,7 @@ Maven
<artifactId>redisson-hibernate-53</artifactId>
<!-- for Hibernate v6.0.2+ - v6.1.x -->
<artifactId>redisson-hibernate-6</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
@ -48,15 +48,15 @@ Gradle
```groovy
// for Hibernate v4.x
compile 'org.redisson:redisson-hibernate-4:3.18.1'
compile 'org.redisson:redisson-hibernate-4:3.19.0'
// for Hibernate v5.0.x - v5.1.x
compile 'org.redisson:redisson-hibernate-5:3.18.1'
compile 'org.redisson:redisson-hibernate-5:3.19.0'
// for Hibernate v5.2.x
compile 'org.redisson:redisson-hibernate-52:3.18.1'
compile 'org.redisson:redisson-hibernate-52:3.19.0'
// for Hibernate v5.3.3+ - v5.6.x
compile 'org.redisson:redisson-hibernate-53:3.18.1'
compile 'org.redisson:redisson-hibernate-53:3.19.0'
// for Hibernate v6.0.2+ - v6.1.x
compile 'org.redisson:redisson-hibernate-6:3.18.1'
compile 'org.redisson:redisson-hibernate-6:3.19.0'
```
### 2. Specify hibernate cache settings

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-hibernate</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -37,6 +37,22 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<argLine>
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/1.49/jmockit-1.49.jar
</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-hibernate</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -57,6 +57,22 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<argLine>
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/1.49/jmockit-1.49.jar
</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-hibernate</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -50,6 +50,21 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<argLine>
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/1.49/jmockit-1.49.jar
</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-hibernate</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -26,6 +26,12 @@
<artifactId>hibernate-testing</artifactId>
<version>5.6.12.Final</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@ -40,10 +46,37 @@
<version>2.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.36</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<argLine>
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/1.49/jmockit-1.49.jar
</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012 Nikita Koksharov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy.MM.dd HH:mm:ss.SSS} %-5level %c{0} : %msg%n</pattern>
</encoder>
</appender>
<logger name="org.redisson.client" additivity="true">
<level value="info"/>
</logger>
<logger name="org.hibernate.cache" additivity="true">
<level value="info"/>
</logger>
<root>
<level value="info"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-hibernate</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -28,23 +28,40 @@
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.2</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.7.2</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<argLine>
--add-opens=java.base/java.util=ALL-UNNAMED
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/1.49/jmockit-1.49.jar
</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>

@ -17,7 +17,7 @@ Maven
<artifactId>redisson-micronaut-20</artifactId>
<!-- for Micronaut v3.x.x -->
<artifactId>redisson-micronaut-30</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
@ -25,9 +25,9 @@ Gradle
```groovy
// for Micronaut v2.0.x - v2.5.x
compile 'org.redisson:redisson-micronaut-20:3.18.1'
compile 'org.redisson:redisson-micronaut-20:3.19.0'
// for Micronaut v3.x.x
compile 'org.redisson:redisson-micronaut-30:3.18.1'
compile 'org.redisson:redisson-micronaut-30:3.19.0'
```
### 2. Add settings into `application.yml` file
@ -81,7 +81,7 @@ redisson:
|Setting name| `redisson.caches.[CACHE_NAME].codec` |
|Type| `java.lang.Class` |
|Description| Redis data codec applied to cache entries. |
|Default value| `MarshallingCodec` |
|Default value| `Kryo5Codec` |
| | |
|-|-|
@ -143,7 +143,7 @@ redisson:
expire-after-write: 10s
expire-after-access: 3s
max-size: 1000
codec: org.redisson.codec.MarshallingCodec
codec: org.redisson.codec.Kryo5Codec
my-cache2:
expire-after-write: 200s
expire-after-access: 30s
@ -169,7 +169,7 @@ _This feature is available only in [Redisson PRO](https://redisson.pro)_
|Setting name| `redisson.clustered-caches.[CACHE_NAME].codec` |
|Type| `java.lang.Class` |
|Description| Redis data codec applied to cache entries. |
|Default value| `MarshallingCodec` |
|Default value| `Kryo5Codec` |
| | |
|-|-|
@ -230,7 +230,7 @@ redisson:
expire-after-write: 10s
expire-after-access: 3s
max-size: 1000
codec: org.redisson.codec.MarshallingCodec
codec: org.redisson.codec.Kryo5Codec
my-cache2:
expire-after-write: 200s
expire-after-access: 30s
@ -256,7 +256,7 @@ _This feature is available only in [Redisson PRO](https://redisson.pro)_
|Setting name| `redisson.clustered-local-caches.[CACHE_NAME].codec` |
|Type| `java.lang.Class` |
|Description| Redis data codec applied to cache entries. |
|Default value| `MarshallingCodec` |
|Default value| `Kryo5Codec` |
| | |
|-|-|
@ -375,7 +375,7 @@ redisson:
expire-after-write: 10s
expire-after-access: 3s
max-size: 1000
codec: org.redisson.codec.MarshallingCodec
codec: org.redisson.codec.Kryo5Codec
store-сache-miss: true
eviction-policy: `WEAK`
cache-size: 5000
@ -404,7 +404,7 @@ _This feature is available only in [Redisson PRO](https://redisson.pro)_
|Setting name| `redisson.local-caches.[CACHE_NAME].codec` |
|Type| `java.lang.Class` |
|Description| Redis data codec applied to cache entries. |
|Default value| `MarshallingCodec` |
|Default value| `Kryo5Codec` |
| | |
|-|-|
@ -523,7 +523,7 @@ redisson:
expire-after-write: 10s
expire-after-access: 3s
max-size: 1000
codec: org.redisson.codec.MarshallingCodec
codec: org.redisson.codec.Kryo5Codec
store-сache-miss: true
eviction-policy: `WEAK`
cache-size: 5000
@ -542,7 +542,7 @@ Additional settings to [HttpSessionConfiguration](https://docs.micronaut.io/2.5.
|------------|----|-----------|
|micronaut.session.http.redisson.enabled|java.lang.Boolean|Enables Session store|
|micronaut.session.http.redisson.key-prefix|java.lang.Integer|Defines string prefix applied to all objects stored in Redis.|
|micronaut.session.http.redisson.codec|java.lang.Class|Redis data codec applied to cache entries. Default is MarshallingCodec codec.|
|micronaut.session.http.redisson.codec|java.lang.Class|Redis data codec applied to cache entries. Default is Kryo5Codec codec.|
|micronaut.session.http.redisson.update-mode|java.lang.String|Defines session attributes update mode.<br/>`WRITE_BEHIND` - session changes stored asynchronously.<br/>`AFTER_REQUEST` - session changes stored only on `SessionStore#save(Session)` method invocation. Default value.|
|micronaut.session.http.redisson.broadcastSessionUpdates|java.lang.Boolean|Defines broadcasting of session updates across all micronaut services.|

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-micronaut</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -18,7 +18,11 @@ package org.redisson.micronaut;
import io.micronaut.context.annotation.ConfigurationBuilder;
import io.micronaut.context.annotation.ConfigurationProperties;
import io.micronaut.context.annotation.Requires;
import org.redisson.client.NettyHook;
import org.redisson.client.codec.Codec;
import org.redisson.config.*;
import org.redisson.connection.AddressResolverGroupFactory;
import org.redisson.connection.ConnectionListener;
/**
*
@ -110,4 +114,65 @@ public class RedissonConfiguration extends Config {
protected void setMasterSlaveServersConfig(MasterSlaveServersConfig masterSlaveConnectionConfig) {
super.setMasterSlaveServersConfig(masterSlaveConnectionConfig);
}
@Override
@ConfigurationBuilder(value = "codec1")
public Config setCodec(Codec codec) {
return super.setCodec(codec);
}
public Config setCodec(String className) {
try {
Codec codec = (Codec) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setCodec(codec);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
@ConfigurationBuilder(value = "nettyHook1")
public Config setNettyHook(NettyHook nettyHook) {
return super.setNettyHook(nettyHook);
}
public Config setNettyHook(String className) {
try {
NettyHook nettyHook = (NettyHook) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setNettyHook(nettyHook);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
@ConfigurationBuilder(value = "addressResolverGroupFactory1")
public Config setAddressResolverGroupFactory(AddressResolverGroupFactory addressResolverGroupFactory) {
return super.setAddressResolverGroupFactory(addressResolverGroupFactory);
}
public Config setAddressResolverGroupFactory(String className) {
try {
AddressResolverGroupFactory value = (AddressResolverGroupFactory) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setAddressResolverGroupFactory(value);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
@ConfigurationBuilder(value = "connectionListener1")
public Config setConnectionListener(ConnectionListener connectionListener) {
return super.setConnectionListener(connectionListener);
}
public Config setConnectionListener(String className) {
try {
ConnectionListener connectionListener = (ConnectionListener) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setConnectionListener(connectionListener);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
}

@ -57,10 +57,10 @@ public class BaseCacheConfiguration implements Named {
/**
* Redis data codec applied to cache entries.
* Default is MarshallingCodec codec
* Default is Kryo5Codec codec
*
* @see Codec
* @see org.redisson.codec.MarshallingCodec
* @see org.redisson.codec.Kryo5Codec
*
* @param codec - data codec
* @return config

@ -72,10 +72,10 @@ public class RedissonHttpSessionConfiguration extends HttpSessionConfiguration i
/**
* Redis data codec applied to session values.
* Default is MarshallingCodec codec
* Default is Kryo5Codec codec
*
* @see org.redisson.client.codec.Codec
* @see org.redisson.codec.MarshallingCodec
* @see org.redisson.codec.Kryo5Codec
*
* @param codec - data codec
* @return config

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-micronaut</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -17,8 +17,15 @@ package org.redisson.micronaut;
import io.micronaut.context.annotation.ConfigurationBuilder;
import io.micronaut.context.annotation.ConfigurationProperties;
import io.micronaut.context.annotation.Parameter;
import io.micronaut.context.annotation.Requires;
import org.redisson.client.NettyHook;
import org.redisson.client.codec.Codec;
import org.redisson.config.*;
import org.redisson.connection.AddressResolverGroupFactory;
import org.redisson.connection.ConnectionListener;
import java.lang.reflect.InvocationTargetException;
/**
*
@ -110,4 +117,65 @@ public class RedissonConfiguration extends Config {
protected void setMasterSlaveServersConfig(MasterSlaveServersConfig masterSlaveConnectionConfig) {
super.setMasterSlaveServersConfig(masterSlaveConnectionConfig);
}
@Override
@ConfigurationBuilder(value = "codec1")
public Config setCodec(Codec codec) {
return super.setCodec(codec);
}
public Config setCodec(String className) {
try {
Codec codec = (Codec) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setCodec(codec);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
@ConfigurationBuilder(value = "nettyHook1")
public Config setNettyHook(NettyHook nettyHook) {
return super.setNettyHook(nettyHook);
}
public Config setNettyHook(String className) {
try {
NettyHook nettyHook = (NettyHook) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setNettyHook(nettyHook);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
@ConfigurationBuilder(value = "addressResolverGroupFactory1")
public Config setAddressResolverGroupFactory(AddressResolverGroupFactory addressResolverGroupFactory) {
return super.setAddressResolverGroupFactory(addressResolverGroupFactory);
}
public Config setAddressResolverGroupFactory(String className) {
try {
AddressResolverGroupFactory value = (AddressResolverGroupFactory) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setAddressResolverGroupFactory(value);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
@ConfigurationBuilder(value = "connectionListener1")
public Config setConnectionListener(ConnectionListener connectionListener) {
return super.setConnectionListener(connectionListener);
}
public Config setConnectionListener(String className) {
try {
ConnectionListener connectionListener = (ConnectionListener) Class.forName(className).getDeclaredConstructor().newInstance();
return super.setConnectionListener(connectionListener);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
}

@ -57,10 +57,10 @@ public class BaseCacheConfiguration implements Named {
/**
* Redis data codec applied to cache entries.
* Default is MarshallingCodec codec
* Default is Kryo5Codec codec
*
* @see Codec
* @see org.redisson.codec.MarshallingCodec
* @see org.redisson.codec.Kryo5Codec
*
* @param codec - data codec
* @return config

@ -72,10 +72,10 @@ public class RedissonHttpSessionConfiguration extends HttpSessionConfiguration i
/**
* Redis data codec applied to session values.
* Default is MarshallingCodec codec
* Default is Kryo5Codec codec
*
* @see org.redisson.client.codec.Codec
* @see org.redisson.codec.MarshallingCodec
* @see org.redisson.codec.Kryo5Codec
*
* @param codec - data codec
* @return config

@ -30,14 +30,14 @@ Maven
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-mybatis</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
Gradle
```groovy
compile 'org.redisson:redisson-mybatis:3.18.1'
compile 'org.redisson:redisson-mybatis:3.19.0'
```
### 2. Specify MyBatis cache settings

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -42,7 +42,7 @@ Maven
<artifactId>redisson-quarkus-16</artifactId>
<!-- for Quarkus v2.x.x -->
<artifactId>redisson-quarkus-20</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
@ -50,9 +50,9 @@ Gradle
```groovy
// for Quarkus v1.6.x - v1.13.x
compile 'org.redisson:redisson-quarkus-16:3.18.1'
compile 'org.redisson:redisson-quarkus-16:3.19.0'
// for Quarkus v2.x.x
compile 'org.redisson:redisson-quarkus-20:3.18.1'
compile 'org.redisson:redisson-quarkus-20:3.19.0'
```
### 2. Add settings into `application.properties` file
@ -66,7 +66,7 @@ Config structure is a flat Redisson YAML configuration -
NOTE: Setting names in camel case should be joined with hyphens (-).
Below is the configuration for Redisson in single mode.
Below is configuration example for Redisson in single mode.
```
quarkus.redisson.single-server-config.address=redis://localhost:6379
quarkus.redisson.single-server-config.password=null

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -5,7 +5,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-16-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -64,8 +64,7 @@ class QuarkusRedissonClientProcessor {
nativeResources.produce(new NativeImageResourceBuildItem("META-INF/services/org.jboss.marshalling.ProviderDescriptor"));
watchedFiles.produce(new HotDeploymentWatchedFileBuildItem("redisson.yaml"));
reflectiveItems.produce(new ReflectiveClassBuildItem(false, false, "org.redisson.codec.MarshallingCodec"));
reflectiveItems.produce(new ReflectiveClassBuildItem(false, false, "org.jboss.marshalling.river.RiverProviderDescriptor"));
reflectiveItems.produce(new ReflectiveClassBuildItem(false, false, "org.redisson.codec.Kryo5Codec"));
reflectiveItems.produce(new ReflectiveClassBuildItem(true, false, "org.redisson.executor.RemoteExecutorService"));
reflectiveItems.produce(new ReflectiveClassBuildItem(true, false, "org.redisson.executor.RemoteExecutorServiceAsync"));

@ -5,7 +5,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-16-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -3,4 +3,4 @@ quarkus.redisson.single-server-config.password=null
#quarkus.redisson.cluster-servers-config.nodeAddresses=redis://127.0.0.1:7004,redis://127.0.0.1:7001
#quarkus.redisson.cluster-servers-config.password=null
quarkus.redisson.threads=16
quarkus.redisson.codec=org.redisson.codec.MarshallingCodec
quarkus.redisson.codec=org.redisson.codec.Kryo5Codec

@ -21,7 +21,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -5,7 +5,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-16-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -5,7 +5,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-20-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -64,8 +64,7 @@ class QuarkusRedissonClientProcessor {
nativeResources.produce(new NativeImageResourceBuildItem("META-INF/services/org.jboss.marshalling.ProviderDescriptor"));
watchedFiles.produce(new HotDeploymentWatchedFileBuildItem("redisson.yaml"));
reflectiveItems.produce(new ReflectiveClassBuildItem(false, false, "org.redisson.codec.MarshallingCodec"));
reflectiveItems.produce(new ReflectiveClassBuildItem(false, false, "org.jboss.marshalling.river.RiverProviderDescriptor"));
reflectiveItems.produce(new ReflectiveClassBuildItem(false, false, "org.redisson.codec.Kryo5Codec"));
reflectiveItems.produce(new ReflectiveClassBuildItem(true, false, "org.redisson.executor.RemoteExecutorService"));
reflectiveItems.produce(new ReflectiveClassBuildItem(true, false, "org.redisson.executor.RemoteExecutorServiceAsync"));

@ -5,7 +5,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-20-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -3,4 +3,4 @@ quarkus.redisson.single-server-config.password=null
#quarkus.redisson.cluster-servers-config.nodeAddresses=redis://127.0.0.1:7004,redis://127.0.0.1:7001
#quarkus.redisson.cluster-servers-config.password=null
quarkus.redisson.threads=16
quarkus.redisson.codec=org.redisson.codec.MarshallingCodec
quarkus.redisson.codec=org.redisson.codec.Kryo5Codec

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-20-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -14,14 +14,14 @@ Maven
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
Gradle
```groovy
compile 'org.redisson:redisson-spring-boot-starter:3.18.1'
compile 'org.redisson:redisson-spring-boot-starter:3.19.0'
```
@ -101,7 +101,7 @@ spring:
tcpNoDelay: false
threads: 16
nettyThreads: 32
codec: !<org.redisson.codec.MarshallingCodec> {}
codec: !<org.redisson.codec.Kryo5Codec> {}
transportMode: "NIO"
```

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -35,7 +35,7 @@ Maven
<artifactId>redisson-spring-data-27</artifactId>
<!-- for Spring Data Redis v.3.0.x -->
<artifactId>redisson-spring-data-30</artifactId>
<version>3.18.1</version>
<version>3.19.0</version>
</dependency>
```
@ -43,29 +43,29 @@ Gradle
```groovy
// for Spring Data Redis v.1.6.x
compile 'org.redisson:redisson-spring-data-16:3.18.1'
compile 'org.redisson:redisson-spring-data-16:3.19.0'
// for Spring Data Redis v.1.7.x
compile 'org.redisson:redisson-spring-data-17:3.18.1'
compile 'org.redisson:redisson-spring-data-17:3.19.0'
// for Spring Data Redis v.1.8.x
compile 'org.redisson:redisson-spring-data-18:3.18.1'
compile 'org.redisson:redisson-spring-data-18:3.19.0'
// for Spring Data Redis v.2.0.x
compile 'org.redisson:redisson-spring-data-20:3.18.1'
compile 'org.redisson:redisson-spring-data-20:3.19.0'
// for Spring Data Redis v.2.1.x
compile 'org.redisson:redisson-spring-data-21:3.18.1'
compile 'org.redisson:redisson-spring-data-21:3.19.0'
// for Spring Data Redis v.2.2.x
compile 'org.redisson:redisson-spring-data-22:3.18.1'
compile 'org.redisson:redisson-spring-data-22:3.19.0'
// for Spring Data Redis v.2.3.x
compile 'org.redisson:redisson-spring-data-23:3.18.1'
compile 'org.redisson:redisson-spring-data-23:3.19.0'
// for Spring Data Redis v.2.4.x
compile 'org.redisson:redisson-spring-data-24:3.18.1'
compile 'org.redisson:redisson-spring-data-24:3.19.0'
// for Spring Data Redis v.2.5.x
compile 'org.redisson:redisson-spring-data-25:3.18.1'
compile 'org.redisson:redisson-spring-data-25:3.19.0'
// for Spring Data Redis v.2.6.x
compile 'org.redisson:redisson-spring-data-26:3.18.1'
compile 'org.redisson:redisson-spring-data-26:3.19.0'
// for Spring Data Redis v.2.7.x
compile 'org.redisson:redisson-spring-data-27:3.18.1'
compile 'org.redisson:redisson-spring-data-27:3.19.0'
// for Spring Data Redis v.3.0.x
compile 'org.redisson:redisson-spring-data-30:3.18.1'
compile 'org.redisson:redisson-spring-data-30:3.19.0'
```
### 2. Register `RedissonConnectionFactory` in Spring context

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -67,14 +67,14 @@ Amount of Redisson instances created by Tomcat for multiple contexts could be re
### 2. Copy two jars into `TOMCAT_BASE/lib` directory:
[redisson-all-3.18.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.18.1&e=jar)
[redisson-all-3.19.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.19.0&e=jar)
Tomcat 7.x - [redisson-tomcat-7-3.18.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=3.18.1&e=jar)
Tomcat 7.x - [redisson-tomcat-7-3.19.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=3.19.0&e=jar)
Tomcat 8.x - [redisson-tomcat-8-3.18.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=3.18.1&e=jar)
Tomcat 8.x - [redisson-tomcat-8-3.19.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=3.19.0&e=jar)
Tomcat 9.x - [redisson-tomcat-9-3.18.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-9&v=3.18.1&e=jar)
Tomcat 9.x - [redisson-tomcat-9-3.19.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-9&v=3.19.0&e=jar)
Tomcat 10.x - [redisson-tomcat-10-3.18.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-10&v=3.18.1&e=jar)
Tomcat 10.x - [redisson-tomcat-10-3.19.0.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-10&v=3.19.0&e=jar)
Try __[Redisson PRO](https://redisson.pro)__ with **ultra-fast performance** and **support by SLA**.

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-tomcat</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-tomcat</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-tomcat</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-tomcat</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

@ -4,7 +4,7 @@
<parent>
<groupId>org.redisson</groupId>
<artifactId>redisson-parent</artifactId>
<version>3.18.2-SNAPSHOT</version>
<version>3.19.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@ -126,6 +126,11 @@
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
@ -187,11 +192,19 @@
<groupId>org.jboss.marshalling</groupId>
<artifactId>jboss-marshalling</artifactId>
<version>2.0.11.Final</version>
<!--
<scope>provided</scope>
<optional>true</optional>
-->
</dependency>
<dependency>
<groupId>org.jboss.marshalling</groupId>
<artifactId>jboss-marshalling-river</artifactId>
<version>2.0.11.Final</version>
<!--
<scope>provided</scope>
<optional>true</optional>
-->
</dependency>
<dependency>
<groupId>org.msgpack</groupId>
@ -213,13 +226,17 @@
<version>2.57</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>5.3.0</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>

@ -93,7 +93,7 @@ public class MapWriteBehindTask {
deletedKeys.clear();
}
} catch (Exception exception) {
log.error("Unable to delete keys: " + deletedKeys, exception);
log.error("Unable to delete keys: {}", deletedKeys, exception);
}
try {
if (!addedMap.isEmpty()) {
@ -105,7 +105,7 @@ public class MapWriteBehindTask {
addedMap.clear();
}
} catch (Exception exception) {
log.error("Unable to add keys: " + addedMap, exception);
log.error("Unable to add keys: {}", addedMap, exception);
}
}
@ -124,7 +124,7 @@ public class MapWriteBehindTask {
}
} catch (Exception exception) {
log.error("Unable to delete keys: " + deletedKeys, exception);
log.error("Unable to delete keys: {}", deletedKeys, exception);
}
}
} else {
@ -140,7 +140,7 @@ public class MapWriteBehindTask {
addedMap.clear();
}
} catch (Exception exception) {
log.error("Unable to add keys: " + addedMap, exception);
log.error("Unable to add keys: {}", addedMap, exception);
}
}
}

@ -56,12 +56,12 @@ public class RedisNodes<N extends Node> implements NodesGroup<N> {
RedisURI addr = new RedisURI(address);
for (MasterSlaveEntry masterSlaveEntry : entries) {
if (masterSlaveEntry.getAllEntries().isEmpty()
&& RedisURI.compare(masterSlaveEntry.getClient().getAddr(), addr)) {
&& addr.equals(masterSlaveEntry.getClient().getAddr())) {
return (N) new RedisClientEntry(masterSlaveEntry.getClient(), commandExecutor, NodeType.MASTER);
}
for (ClientConnectionsEntry entry : masterSlaveEntry.getAllEntries()) {
if (RedisURI.compare(entry.getClient().getAddr(), addr)
if (addr.equals(entry.getClient().getAddr())
&& entry.getFreezeReason() != FreezeReason.MANAGER) {
return (N) new RedisClientEntry(entry.getClient(), commandExecutor, entry.getNodeType());
}

@ -140,7 +140,7 @@ public abstract class RedissonBaseLock extends RedissonExpirable implements RLoc
CompletionStage<Boolean> future = renewExpirationAsync(threadId);
future.whenComplete((res, e) -> {
if (e != null) {
log.error("Can't update lock " + getRawName() + " expiration", e);
log.error("Can't update lock {} expiration", getRawName(), e);
EXPIRATION_RENEWAL_MAP.remove(getEntryName());
return;
}

@ -187,7 +187,7 @@ public class RedissonBloomFilter<T> extends RedissonExpirable implements RBloomF
}
protected RBitSetAsync createBitSet(CommandBatchService executorService) {
return new RedissonBitSet(executorService, getRawName());
return new RedissonBitSet(executorService, getName());
}
private void addConfigCheck(int hashIterations, long size, CommandBatchService executorService) {

@ -261,10 +261,10 @@ public class RedissonExecutorService implements RScheduledExecutorService {
+ "for i = 1, #expiredTaskIds, 1 do "
+ "local name = expiredTaskIds[i];"
+ "local scheduledName = expiredTaskIds[i];"
+ "if string.sub(scheduledName, 1, 2) ~= 'ff' then "
+ "scheduledName = 'ff' .. scheduledName; "
+ "if string.sub(scheduledName, 1, 3) ~= 'ff:' then "
+ "scheduledName = 'ff:' .. scheduledName; "
+ "else "
+ "name = string.sub(name, 3, string.len(name)); "
+ "name = string.sub(name, 4, string.len(name)); "
+ "end;"
+ "redis.call('zadd', KEYS[2], startTime, scheduledName);"

@ -35,14 +35,23 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
/**
* Redis based implementation of Fenced Lock with reentrancy support.
* <p>
* Each lock acquisition increases fencing token. It should be
* checked if it's greater or equal with the previous one by
* the service guarded by this lock and reject operation if condition is false.
*
* @author Nikita Koksharov
*
*/
public class RedissonFencedLock extends RedissonLock implements RFencedLock {
private final String tokenName;
public RedissonFencedLock(CommandAsyncExecutor commandExecutor, String name) {
super(commandExecutor, name);
}
String getTokenName() {
return prefixName("redisson_lock_token", getRawName());
tokenName = prefixName("redisson_lock_token", getRawName());
}
@Override
@ -52,7 +61,7 @@ public class RedissonFencedLock extends RedissonLock implements RFencedLock {
@Override
public RFuture<Long> getTokenAsync() {
return commandExecutor.writeAsync(getTokenName(), StringCodec.INSTANCE, RedisCommands.GET_LONG, getTokenName());
return commandExecutor.writeAsync(tokenName, StringCodec.INSTANCE, RedisCommands.GET_LONG, tokenName);
}
@Override
@ -105,7 +114,7 @@ public class RedissonFencedLock extends RedissonLock implements RFencedLock {
"return {-1, token}; " +
"end; " +
"return {redis.call('pttl', KEYS[1]), -1};",
Arrays.asList(getRawName(), getTokenName()),
Arrays.asList(getRawName(), tokenName),
unit.toMillis(leaseTime), getLockName(threadId));
}
@ -298,8 +307,34 @@ public class RedissonFencedLock extends RedissonLock implements RFencedLock {
"return nil; " +
"end; " +
"return redis.call('pttl', KEYS[1]);",
Arrays.asList(getRawName(), getTokenName()),
Arrays.asList(getRawName(), tokenName),
unit.toMillis(leaseTime), getLockName(threadId));
}
@Override
public RFuture<Boolean> deleteAsync() {
return deleteAsync(getRawName(), tokenName);
}
@Override
public RFuture<Long> sizeInMemoryAsync() {
List<Object> keys = Arrays.asList(getRawName(), tokenName);
return super.sizeInMemoryAsync(keys);
}
@Override
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String param, String... keys) {
return super.expireAsync(timeToLive, timeUnit, param, getRawName(), tokenName);
}
@Override
protected RFuture<Boolean> expireAtAsync(long timestamp, String param, String... keys) {
return super.expireAtAsync(timestamp, param, getRawName(), tokenName);
}
@Override
public RFuture<Boolean> clearExpireAsync() {
return clearExpireAsync(getRawName(), tokenName);
}
}

@ -199,7 +199,7 @@ public class RedissonFuction implements RFunction {
args.add(name);
args.add(keys.size());
if (keys.size() > 0) {
args.add(keys);
args.addAll(keys);
}
args.addAll(encode(Arrays.asList(values), codec));
if (mode == FunctionMode.READ) {

@ -258,6 +258,7 @@ public class RedissonLiveObjectService implements RLiveObjectService {
private <T> T persist(T detachedObject, Map<Object, Object> alreadyPersisted, RCascadeType type) {
validateDetached(detachedObject);
Object id = getId(detachedObject);
T attachedObject = attach(detachedObject);

@ -1723,7 +1723,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
return;
}
} catch (Exception e) {
log.error("Unable to load value by key " + key + " for map " + getRawName(), e);
log.error("Unable to load value by key {} for map {}", key, getRawName(), e);
lock.unlockAsync(threadId)
.whenComplete((r, ex) -> {
if (ex != null) {
@ -1765,7 +1765,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
return lock.unlockAsync(threadId);
}
if (ex != null) {
log.error("Unable to load value by key " + key + " for map " + getRawName(), ex);
log.error("Unable to load value by key {} for map {}", key, getRawName(), ex);
return lock.unlockAsync(threadId);
}
@ -1776,7 +1776,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
return (CompletionStage<V>) putOperationAsync(key, (V) value).handle((r, ex) -> {
RFuture<Void> f = lock.unlockAsync(threadId);
if (ex != null) {
log.error("Unable to store value by key " + key + " for map " + getRawName(), ex);
log.error("Unable to store value by key {} for map {}", key, getRawName(), ex);
return f;
}
return f.thenApply(res -> value);

@ -2265,85 +2265,99 @@ public class RedissonMapCache<K, V> extends RedissonMap<K, V> implements RMapCac
params.toArray());
}
private MapCacheEventCodec.OSType osType;
private volatile MapCacheEventCodec.OSType osType;
private volatile Codec topicCodec;
@Override
public int addListener(MapEntryListener listener) {
if (listener == null) {
throw new NullPointerException();
}
return get(addListenerAsync(listener));
}
@Override
public RFuture<Integer> addListenerAsync(MapEntryListener listener) {
Objects.requireNonNull(listener);
CompletionStage<MapCacheEventCodec.OSType> osTypeFuture = CompletableFuture.completedFuture(osType);
if (osType == null) {
RFuture<Map<String, String>> serverFuture = commandExecutor.readAsync((String) null, StringCodec.INSTANCE, RedisCommands.INFO_SERVER);
String os = serverFuture.toCompletableFuture().join().get("os");
if (os == null || os.contains("Windows")) {
osType = BaseEventCodec.OSType.WINDOWS;
} else if (os.contains("NONSTOP")) {
osType = BaseEventCodec.OSType.HPNONSTOP;
}
}
if (listener instanceof EntryRemovedListener) {
RTopic topic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getRemovedChannelName());
return topic.addListener(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.REMOVED, (K) msg.get(0), (V) msg.get(1), null);
((EntryRemovedListener<K, V>) listener).onRemoved(event);
osTypeFuture = serverFuture.thenApply(res -> {
String os = res.get("os");
if (os == null || os.contains("Windows")) {
osType = BaseEventCodec.OSType.WINDOWS;
} else if (os.contains("NONSTOP")) {
osType = BaseEventCodec.OSType.HPNONSTOP;
}
topicCodec = new MapCacheEventCodec(codec, osType);
return osType;
});
}
if (listener instanceof EntryCreatedListener) {
RTopic topic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getCreatedChannelName());
return topic.addListener(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.CREATED, (K) msg.get(0), (V) msg.get(1), null);
((EntryCreatedListener<K, V>) listener).onCreated(event);
}
});
}
CompletionStage<Integer> f = osTypeFuture.thenCompose(osType -> {
if (listener instanceof EntryRemovedListener) {
RTopic topic = RedissonTopic.createRaw(topicCodec, commandExecutor, getRemovedChannelName());
return topic.addListenerAsync(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.REMOVED, (K) msg.get(0), (V) msg.get(1), null);
((EntryRemovedListener<K, V>) listener).onRemoved(event);
}
});
}
if (listener instanceof EntryUpdatedListener) {
RTopic topic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getUpdatedChannelName());
return topic.addListener(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.UPDATED, (K) msg.get(0), (V) msg.get(1), (V) msg.get(2));
((EntryUpdatedListener<K, V>) listener).onUpdated(event);
}
});
}
if (listener instanceof EntryCreatedListener) {
RTopic topic = RedissonTopic.createRaw(topicCodec, commandExecutor, getCreatedChannelName());
return topic.addListenerAsync(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.CREATED, (K) msg.get(0), (V) msg.get(1), null);
((EntryCreatedListener<K, V>) listener).onCreated(event);
}
});
}
if (listener instanceof EntryExpiredListener) {
RTopic topic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getExpiredChannelName());
return topic.addListener(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.EXPIRED, (K) msg.get(0), (V) msg.get(1), null);
((EntryExpiredListener<K, V>) listener).onExpired(event);
}
});
}
if (listener instanceof EntryUpdatedListener) {
RTopic topic = RedissonTopic.createRaw(topicCodec, commandExecutor, getUpdatedChannelName());
return topic.addListenerAsync(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.UPDATED, (K) msg.get(0), (V) msg.get(1), (V) msg.get(2));
((EntryUpdatedListener<K, V>) listener).onUpdated(event);
}
});
}
throw new IllegalArgumentException("Wrong listener type " + listener.getClass());
if (listener instanceof EntryExpiredListener) {
RTopic topic = RedissonTopic.createRaw(topicCodec, commandExecutor, getExpiredChannelName());
return topic.addListenerAsync(List.class, new MessageListener<List<Object>>() {
@Override
public void onMessage(CharSequence channel, List<Object> msg) {
EntryEvent<K, V> event = new EntryEvent<K, V>(RedissonMapCache.this, EntryEvent.Type.EXPIRED, (K) msg.get(0), (V) msg.get(1), null);
((EntryExpiredListener<K, V>) listener).onExpired(event);
}
});
}
CompletableFuture<Integer> res = new CompletableFuture<>();
res.completeExceptionally(new IllegalArgumentException("Wrong listener type " + listener.getClass()));
return res;
});
return new CompletableFutureWrapper<>(f);
}
@Override
public void removeListener(int listenerId) {
super.removeListener(listenerId);
RTopic removedTopic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getRemovedChannelName());
RTopic removedTopic = RedissonTopic.createRaw(topicCodec, commandExecutor, getRemovedChannelName());
removedTopic.removeListener(listenerId);
RTopic createdTopic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getCreatedChannelName());
RTopic createdTopic = RedissonTopic.createRaw(topicCodec, commandExecutor, getCreatedChannelName());
createdTopic.removeListener(listenerId);
RTopic updatedTopic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getUpdatedChannelName());
RTopic updatedTopic = RedissonTopic.createRaw(topicCodec, commandExecutor, getUpdatedChannelName());
updatedTopic.removeListener(listenerId);
RTopic expiredTopic = RedissonTopic.createRaw(new MapCacheEventCodec(codec, osType), commandExecutor, getExpiredChannelName());
RTopic expiredTopic = RedissonTopic.createRaw(topicCodec, commandExecutor, getExpiredChannelName());
expiredTopic.removeListener(listenerId);
}

@ -94,7 +94,7 @@ public final class RedissonNode {
try {
config = RedissonNodeFileConfig.fromYAML(new File(configPath));
} catch (IOException e1) {
log.error("Can't parse json config " + configPath, e);
log.error("Can't parse json config {}", configPath, e);
throw new IllegalArgumentException("Can't parse yaml config " + configPath, e1);
}
}

@ -40,6 +40,7 @@ import java.util.concurrent.atomic.AtomicReference;
*/
public class RedissonPermitExpirableSemaphore extends RedissonExpirable implements RPermitExpirableSemaphore {
private final String channelName;
private final SemaphorePubSub semaphorePubSub;
final CommandAsyncExecutor commandExecutor;
@ -50,20 +51,10 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
public RedissonPermitExpirableSemaphore(CommandAsyncExecutor commandExecutor, String name) {
super(commandExecutor, name);
this.timeoutName = suffixName(name, "timeout");
this.timeoutName = suffixName(getRawName(), "timeout");
this.commandExecutor = commandExecutor;
this.semaphorePubSub = commandExecutor.getConnectionManager().getSubscribeService().getSemaphorePubSub();
}
String getChannelName() {
return getChannelName(getRawName());
}
public static String getChannelName(String name) {
if (name.contains("{")) {
return "redisson_sc:" + name;
}
return "redisson_sc:{" + name + "}";
this.channelName = prefixName("redisson_sc", getRawName());
}
@Override
@ -383,7 +374,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
"return ':' .. tostring(v[2]); " +
"end " +
"return nil;",
Arrays.asList(getRawName(), timeoutName, getChannelName()),
Arrays.asList(getRawName(), timeoutName, channelName),
permits, timeoutDate, id, System.currentTimeMillis(), nonExpirableTimeout);
}
@ -534,11 +525,11 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
}
private CompletableFuture<RedissonLockEntry> subscribe() {
return semaphorePubSub.subscribe(getRawName(), getChannelName());
return semaphorePubSub.subscribe(getRawName(), channelName);
}
private void unsubscribe(RedissonLockEntry entry) {
semaphorePubSub.unsubscribe(entry, getRawName(), getChannelName());
semaphorePubSub.unsubscribe(entry, getRawName(), channelName);
}
@Override
@ -578,7 +569,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
"return 0;" +
"end;" +
"return 1;",
Arrays.asList(getRawName(), getChannelName(), timeoutName),
Arrays.asList(getRawName(), channelName, timeoutName),
id, 1, System.currentTimeMillis());
}
@ -652,7 +643,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
"end; " +
"local ret = redis.call('get', KEYS[1]); " +
"return ret == false and 0 or ret;",
Arrays.<Object>asList(getRawName(), timeoutName, getChannelName()), System.currentTimeMillis());
Arrays.<Object>asList(getRawName(), timeoutName, channelName), System.currentTimeMillis());
}
@Override
@ -733,7 +724,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
+ "return 1;"
+ "end;"
+ "return 0;",
Arrays.<Object>asList(getRawName(), getChannelName()), permits);
Arrays.<Object>asList(getRawName(), channelName), permits);
}
@Override
@ -752,7 +743,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
+ "if tonumber(ARGV[1]) > 0 then "
+ "redis.call('publish', KEYS[2], ARGV[1]); "
+ "end;",
Arrays.<Object>asList(getRawName(), getChannelName()), permits);
Arrays.<Object>asList(getRawName(), channelName), permits);
}
@Override
@ -775,7 +766,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
+ "return 1;"
+ "end;"
+ "return 0;",
Arrays.asList(getRawName(), timeoutName, getChannelName()),
Arrays.asList(getRawName(), timeoutName, channelName),
id, timeoutDate, System.currentTimeMillis());
}

@ -225,11 +225,11 @@ public class RedissonReliableTopic extends RedissonExpirable implements RReliabl
+ "redis.call('hset', KEYS[3], ARGV[2], ARGV[1]); "
+ "end; "
+ "local t = redis.call('zrange', KEYS[5], 0, 0, 'WITHSCORES'); "
+ "if #t == 2 and tonumber(t[2]) < tonumber(ARGV[3]) then "
+ "redis.call('hdel', KEYS[3], t[1]); "
+ "redis.call('zrem', KEYS[2], t[1]); "
+ "redis.call('zrem', KEYS[5], t[1]); "
+ "local expired = redis.call('zrangebyscore', KEYS[5], 0, tonumber(ARGV[3]) - 1); "
+ "for i, v in ipairs(expired) do "
+ "redis.call('hdel', KEYS[3], v); "
+ "redis.call('zrem', KEYS[2], v); "
+ "redis.call('zrem', KEYS[5], v); "
+ "end; "
+ "local v = redis.call('zrange', KEYS[2], 0, 0); "
@ -335,7 +335,7 @@ public class RedissonReliableTopic extends RedissonExpirable implements RReliabl
System.currentTimeMillis() + commandExecutor.getConnectionManager().getCfg().getReliableTopicWatchdogTimeout(), subscriberId.get());
future.whenComplete((res, e) -> {
if (e != null) {
log.error("Can't update reliable topic " + getRawName() + " expiration time", e);
log.error("Can't update reliable topic {} expiration time", getRawName(), e);
return;
}

@ -280,7 +280,7 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS
if (exc instanceof RedissonShutdownException) {
return;
}
log.error("Can't process the remote service request with id " + requestId, exc);
log.error("Can't process the remote service request with id {}", requestId, exc);
// re-subscribe after a failed takeAsync
resubscribe(remoteInterface, requestQueue, executor, bean);
@ -330,7 +330,7 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS
if (ex instanceof RedissonShutdownException) {
return;
}
log.error("Can't send ack for request: " + request, ex);
log.error("Can't send ack for request: {}", request, ex);
// re-subscribe after a failed send (ack)
resubscribe(remoteInterface, requestQueue, executor, bean);
@ -350,7 +350,7 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS
if (exce instanceof RedissonShutdownException) {
return;
}
log.error("Can't send ack for request: " + request, exce);
log.error("Can't send ack for request: {}", request, exce);
// re-subscribe after a failed send (ack)
resubscribe(remoteInterface, requestQueue, executor, bean);
@ -413,13 +413,13 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS
if (exc instanceof RedissonShutdownException) {
return;
}
log.error("Can't send response: " + response + " for request: " + request, exc);
log.error("Can't send response: {} for request: {}", response, request, exc);
}
resubscribe(remoteInterface, requestQueue, executor, method.getBean());
});
} catch (Exception ex) {
log.error("Can't send response: " + result + " for request: " + request, ex);
log.error("Can't send response: {} for request: {}", result, request, ex);
}
} else {
resubscribe(remoteInterface, requestQueue, executor, method.getBean());
@ -465,7 +465,7 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS
} catch (Exception e) {
RemoteServiceResponse response = new RemoteServiceResponse(request.getId(), e.getCause());
responsePromise.complete(response);
log.error("Can't execute: " + request, e);
log.error("Can't execute: {}", request, e);
}
if (cancelRequestFuture != null) {

@ -62,10 +62,7 @@ public class RedissonSemaphore extends RedissonExpirable implements RSemaphore {
}
public static String getChannelName(String name) {
if (name.contains("{")) {
return "redisson_sc:" + name;
}
return "redisson_sc:{" + name + "}";
return prefixName("redisson_sc", name);
}
@Override

@ -26,6 +26,7 @@ import org.redisson.mapreduce.RedissonCollectionMapReduce;
import org.redisson.misc.CompletableFutureWrapper;
import java.util.*;
import java.util.concurrent.CompletionStage;
import java.util.stream.Stream;
/**
@ -379,13 +380,37 @@ public class RedissonSet<V> extends RedissonExpirable implements RSet<V>, ScanIt
return new CompletableFutureWrapper<>(0);
}
List<Object> args = new ArrayList<Object>(c.size() + 1);
List<Object> args = new ArrayList<>(c.size() + 1);
args.add(getRawName());
encode(args, c);
return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.SREM, args.toArray());
}
@Override
public RFuture<List<V>> containsEachAsync(Collection<V> c) {
if (c.isEmpty()) {
return new CompletableFutureWrapper<>(Collections.emptyList());
}
List<Object> args = new ArrayList<>(c.size() + 1);
args.add(getRawName());
encode(args, c);
RFuture<List<Long>> future = commandExecutor.readAsync(getRawName(), codec, RedisCommands.SMISMEMBER, args.toArray());
List<V> keysToCheck = new ArrayList<>(c);
CompletionStage<List<V>> f = future.thenApply(res -> {
List<V> containedKeys = new ArrayList<>();
for (int i = 0; i < res.size(); i++) {
if (res.get(i) == 1) {
containedKeys.add(keysToCheck.get(i));
}
}
return containedKeys;
});
return new CompletableFutureWrapper<>(f);
}
@Override
public boolean removeAll(Collection<?> c) {
return get(removeAllAsync(c));
@ -728,6 +753,11 @@ public class RedissonSet<V> extends RedissonExpirable implements RSet<V>, ScanIt
return get(tryAddAsync(values));
}
@Override
public List<V> containsEach(Collection<V> c) {
return get(containsEachAsync(c));
}
@Override
public RFuture<Boolean> tryAddAsync(V... values) {
return commandExecutor.evalWriteAsync(getRawName(), codec, RedisCommands.EVAL_BOOLEAN,

@ -67,6 +67,11 @@ public class RedissonSetMultimapValues<V> extends RedissonExpirable implements R
return get(tryAddAsync(values));
}
@Override
public List<V> containsEach(Collection<V> c) {
throw new UnsupportedOperationException("This operation is not supported for SetMultimap values");
}
@Override
public RFuture<Boolean> tryAddAsync(V... values) {
return set.tryAddAsync(values);
@ -498,6 +503,11 @@ public class RedissonSetMultimapValues<V> extends RedissonExpirable implements R
throw new UnsupportedOperationException("This operation is not supported for SetMultimap values");
}
@Override
public RFuture<List<V>> containsEachAsync(Collection<V> c) {
throw new UnsupportedOperationException("This operation is not supported for SetMultimap values");
}
@Override
public boolean retainAll(Collection<?> c) {
return get(retainAllAsync(c));

@ -106,7 +106,7 @@ public class RedissonTopic implements RTopic {
@Override
public <M> int addListener(Class<M> type, MessageListener<? extends M> listener) {
RFuture<Integer> future = addListenerAsync(type, (MessageListener<M>) listener);
RFuture<Integer> future = addListenerAsync(type, listener);
return commandExecutor.get(future.toCompletableFuture());
}
@ -117,8 +117,8 @@ public class RedissonTopic implements RTopic {
}
@Override
public <M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<M> listener) {
PubSubMessageListener<M> pubSubListener = new PubSubMessageListener<>(type, listener, name);
public <M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<? extends M> listener) {
PubSubMessageListener<M> pubSubListener = new PubSubMessageListener<>(type, (MessageListener<M>) listener, name);
return addListenerAsync(pubSubListener);
}

@ -38,7 +38,7 @@ public class Version {
}
String name = attrs.getValue("Bundle-Name");
if ("Redisson".equals(name)) {
log.info("Redisson " + attrs.getValue("Bundle-Version"));
log.info("Redisson {}", attrs.getValue("Bundle-Version"));
break;
}
}

@ -258,7 +258,7 @@ public interface RBatch {
* @param name - name of object
* @return ListMultimapCache object
*/
<K, V> RMultimapAsync<K, V> getListMultimapCache(String name);
<K, V> RMultimapCacheAsync<K, V> getListMultimapCache(String name);
/**
* Returns List based Multimap instance by name
@ -273,7 +273,7 @@ public interface RBatch {
* @param codec - codec for keys and values
* @return ListMultimapCache object
*/
<K, V> RMultimapAsync<K, V> getListMultimapCache(String name, Codec codec);
<K, V> RMultimapCacheAsync<K, V> getListMultimapCache(String name, Codec codec);
/**
* Returns map instance by name.

@ -17,6 +17,7 @@ package org.redisson.api;
import org.redisson.api.map.MapLoader;
import org.redisson.api.map.MapWriter;
import org.redisson.api.map.event.MapEntryListener;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@ -305,5 +306,18 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> {
* -1 if the key exists but has no associated expire.
*/
RFuture<Long> remainTimeToLiveAsync(K key);
/**
* Adds map entry listener
*
* @see org.redisson.api.map.event.EntryCreatedListener
* @see org.redisson.api.map.event.EntryUpdatedListener
* @see org.redisson.api.map.event.EntryRemovedListener
* @see org.redisson.api.map.event.EntryExpiredListener
*
* @param listener - entry listener
* @return listener id
*/
RFuture<Integer> addListenerAsync(MapEntryListener listener);
}

@ -16,6 +16,7 @@
package org.redisson.api;
import org.redisson.api.map.MapLoader;
import org.redisson.api.map.event.MapEntryListener;
import reactor.core.publisher.Mono;
import java.util.concurrent.TimeUnit;
@ -291,4 +292,17 @@ public interface RMapCacheReactive<K, V> extends RMapReactive<K, V>, RDestroyabl
*/
Mono<Long> remainTimeToLive(K key);
/**
* Adds map entry listener
*
* @see org.redisson.api.map.event.EntryCreatedListener
* @see org.redisson.api.map.event.EntryUpdatedListener
* @see org.redisson.api.map.event.EntryRemovedListener
* @see org.redisson.api.map.event.EntryExpiredListener
*
* @param listener - entry listener
* @return listener id
*/
Mono<Integer> addListener(MapEntryListener listener);
}

@ -19,6 +19,7 @@ import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.Single;
import org.redisson.api.map.MapLoader;
import org.redisson.api.map.event.MapEntryListener;
import java.util.concurrent.TimeUnit;
@ -293,4 +294,17 @@ public interface RMapCacheRx<K, V> extends RMapRx<K, V>, RDestroyable {
*/
Single<Long> remainTimeToLive(K key);
/**
* Adds map entry listener
*
* @see org.redisson.api.map.event.EntryCreatedListener
* @see org.redisson.api.map.event.EntryUpdatedListener
* @see org.redisson.api.map.event.EntryRemovedListener
* @see org.redisson.api.map.event.EntryExpiredListener
*
* @param listener - entry listener
* @return listener id
*/
Single<Integer> addListener(MapEntryListener listener);
}

@ -19,6 +19,7 @@ import org.redisson.api.mapreduce.RCollectionMapReduce;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.stream.Stream;
@ -324,4 +325,13 @@ public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V>, RSortable<Set
*/
boolean tryAdd(V... values);
/**
* Check if each element is contained in the specified collection.
* Returns contained elements.
*
* @param c - collection to check
* @return contained elements
*/
List<V> containsEach(Collection<V> c);
}

@ -16,6 +16,7 @@
package org.redisson.api;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
@ -179,4 +180,13 @@ public interface RSetAsync<V> extends RCollectionAsync<V>, RSortableAsync<Set<V>
*/
RFuture<Integer> removeAllCountedAsync(Collection<? extends V> c);
/**
* Check if each element is contained in the specified collection.
* Returns contained elements.
*
* @param c - collection to check
* @return contained elements
*/
RFuture<List<V>> containsEachAsync(Collection<V> c);
}

@ -97,5 +97,26 @@ public interface RSetCacheReactive<V> extends RCollectionReactive<V>, RDestroyab
* @return values
*/
Mono<Set<V>> readAll();
/**
* Tries to add elements only if none of them in set.
*
* @param values - values to add
* @return <code>true</code> if elements successfully added,
* otherwise <code>false</code>.
*/
Mono<Boolean> tryAdd(V... values);
/**
* Tries to add elements only if none of them in set.
*
* @param values - values to add
* @param ttl - time to live for value.
* If <code>0</code> then stores infinitely.
* @param unit - time unit
* @return <code>true</code> if elements successfully added,
* otherwise <code>false</code>.
*/
Mono<Boolean> tryAdd(long ttl, TimeUnit unit, V... values);
}

@ -97,5 +97,26 @@ public interface RSetCacheRx<V> extends RCollectionRx<V>, RDestroyable {
* @return values
*/
Single<Set<V>> readAll();
/**
* Tries to add elements only if none of them in set.
*
* @param values - values to add
* @return <code>true</code> if elements successfully added,
* otherwise <code>false</code>.
*/
Single<Boolean> tryAdd(V... values);
/**
* Tries to add elements only if none of them in set.
*
* @param values - values to add
* @param ttl - time to live for value.
* If <code>0</code> then stores infinitely.
* @param unit - time unit
* @return <code>true</code> if elements successfully added,
* otherwise <code>false</code>.
*/
Single<Boolean> tryAdd(long ttl, TimeUnit unit, V... values);
}

@ -19,6 +19,7 @@ import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
@ -239,4 +240,22 @@ public interface RSetReactive<V> extends RCollectionReactive<V>, RSortableReacti
*/
Mono<Set<V>> readIntersection(String... names);
/**
* Tries to add elements only if none of them in set.
*
* @param values - values to add
* @return <code>true</code> if elements successfully added,
* otherwise <code>false</code>.
*/
Mono<Boolean> tryAdd(V... values);
/**
* Check if each element is contained in the specified collection.
* Returns contained elements.
*
* @param c - collection to check
* @return contained elements
*/
Mono<List<V>> containsEach(Collection<V> c);
}

@ -16,6 +16,7 @@
package org.redisson.api;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import io.reactivex.rxjava3.core.Flowable;
@ -241,4 +242,22 @@ public interface RSetRx<V> extends RCollectionRx<V>, RSortableRx<Set<V>> {
*/
Single<Set<V>> readIntersection(String... names);
/**
* Tries to add elements only if none of them in set.
*
* @param values - values to add
* @return <code>true</code> if elements successfully added,
* otherwise <code>false</code>.
*/
Single<Boolean> tryAdd(V... values);
/**
* Check if each element is contained in the specified collection.
* Returns contained elements.
*
* @param c - collection to check
* @return contained elements
*/
Single<List<V>> containsEach(Collection<V> c);
}

@ -54,7 +54,7 @@ public interface RTopicAsync {
* @return locally unique listener id
* @see org.redisson.api.listener.MessageListener
*/
<M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<M> listener);
<M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<? extends M> listener);
/**
* Removes the listener by <code>id</code> for listening this topic

@ -27,14 +27,22 @@ public class StreamGroup {
private final int consumers;
private final int pending;
private final StreamMessageId lastDeliveredId;
private final int entriesRead;
private final int lag;
public StreamGroup(String name, int consumers, int pending, StreamMessageId lastDeliveredId) {
this(name, consumers, pending, lastDeliveredId, 0, 0);
}
public StreamGroup(String name, int consumers, int pending, StreamMessageId lastDeliveredId, int entriesRead, int lag) {
this.name = name;
this.consumers = consumers;
this.pending = pending;
this.lastDeliveredId = lastDeliveredId;
this.entriesRead = entriesRead;
this.lag = lag;
}
/**
* Returns last delivered StreamMessageId for this group
*
@ -70,5 +78,22 @@ public class StreamGroup {
public int getPending() {
return pending;
}
/**
* Returns amount of entries that the group had read
*
* @return amount of read entries
*/
public int getEntriesRead() {
return entriesRead;
}
/**
* Returns amount of entries that are still waiting for delivery
*
* @return amount of entries for delivery
*/
public int getLag() {
return lag;
}
}

@ -0,0 +1,39 @@
/**
* Copyright (c) 2013-2022 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.client;
import org.redisson.config.Credentials;
import org.redisson.config.CredentialsResolver;
import java.net.InetSocketAddress;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
/**
*
* @author Nikita Koksharov
*
*/
public class DefaultCredentialsResolver implements CredentialsResolver {
private final CompletionStage<Credentials> future = CompletableFuture.completedFuture(new Credentials());
@Override
public CompletionStage<Credentials> resolve(InetSocketAddress address) {
return future;
}
}

@ -15,18 +15,18 @@
*/
package org.redisson.client;
import java.net.InetSocketAddress;
import java.net.URL;
import java.util.concurrent.ExecutorService;
import org.redisson.config.SslProvider;
import org.redisson.misc.RedisURI;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.resolver.AddressResolverGroup;
import io.netty.util.Timer;
import org.redisson.config.CredentialsResolver;
import org.redisson.config.SslProvider;
import org.redisson.misc.RedisURI;
import java.net.InetSocketAddress;
import java.net.URL;
import java.util.concurrent.ExecutorService;
/**
*
@ -65,6 +65,7 @@ public class RedisClientConfig {
private String sslKeystorePassword;
private String[] sslProtocols;
private NettyHook nettyHook = new DefaultNettyHook();
private CredentialsResolver credentialsResolver = new DefaultCredentialsResolver();
public RedisClientConfig() {
}
@ -97,13 +98,15 @@ public class RedisClientConfig {
this.sslKeystorePassword = config.sslKeystorePassword;
this.resolverGroup = config.resolverGroup;
this.sslHostname = config.sslHostname;
this.credentialsResolver = config.credentialsResolver;
}
public NettyHook getNettyHook() {
return nettyHook;
}
public void setNettyHook(NettyHook nettyHook) {
public RedisClientConfig setNettyHook(NettyHook nettyHook) {
this.nettyHook = nettyHook;
return this;
}
public String getSslHostname() {
@ -321,4 +324,13 @@ public class RedisClientConfig {
this.sslProtocols = sslProtocols;
return this;
}
public CredentialsResolver getCredentialsResolver() {
return credentialsResolver;
}
public RedisClientConfig setCredentialsResolver(CredentialsResolver credentialsResolver) {
this.credentialsResolver = credentialsResolver;
return this;
}
}

@ -69,7 +69,7 @@ public class RedisConnection implements RedisCommands {
updateChannel(channel);
lastUsageTime = System.nanoTime();
LOG.debug("Connection created " + redisClient);
LOG.debug("Connection created {}", redisClient);
}
protected RedisConnection(RedisClient redisClient) {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save