Skip to content

Commit 4b8aa8e

Browse files
denglimingclaude
andcommitted
Upgrade Redisson from 3.27.1 to 4.7.0
Redisson 4.x keeps the internal surface this project relies on and still targets Java 8; the default protocol remains RESP2. Two adaptations: - MultiDecoder.getDecoder() gained a size parameter; the RedisBloom INFO decoders and the vector set RawVectorDecoder override the new signature. - Config.fromJSON(String) is gone and Config.fromYAML(String) no longer throws IOException. The starter parses configuration with fromYAML only, which also accepts JSON since YAML is a superset of it. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 98ac571 commit 4b8aa8e

9 files changed

Lines changed: 12 additions & 19 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ users; they will be removed in a future major release.
4141
- Java 8 or later
4242
- Redis 8.x (modules built in), or Redis 7.x with the corresponding module loaded
4343
- Vector sets need Redis 8.0+ (`VRANGE` needs 8.4+)
44-
- Redisson 3.27.x (pulled in transitively)
44+
- Redisson 4.7.x (pulled in transitively)
4545

4646
## Installation
4747

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<properties>
5656
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
57-
<redisson.version>3.27.1</redisson.version>
57+
<redisson.version>4.7.0</redisson.version>
5858
<junit.version>5.6.3</junit.version>
5959
<java.version>1.8</java.version>
6060
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>

‎redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/decoder/BloomFilterDecoder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class BloomFilterDecoder implements MultiDecoder<BloomFilterInfo> {
3131
* Field names arrive as bulk strings; decode them as plain strings whatever codec the caller uses.
3232
*/
3333
@Override
34-
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state) {
34+
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state, long size) {
3535
return StringCodec.INSTANCE.getValueDecoder();
3636
}
3737

‎redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/decoder/CountMinSketchDecoder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class CountMinSketchDecoder implements MultiDecoder<CountMinSketchInfo> {
3131
* Field names arrive as bulk strings; decode them as plain strings whatever codec the caller uses.
3232
*/
3333
@Override
34-
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state) {
34+
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state, long size) {
3535
return StringCodec.INSTANCE.getValueDecoder();
3636
}
3737

‎redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/decoder/CuckooFilterDecoder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class CuckooFilterDecoder implements MultiDecoder<CuckooFilterInfo> {
3131
* Field names arrive as bulk strings; decode them as plain strings whatever codec the caller uses.
3232
*/
3333
@Override
34-
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state) {
34+
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state, long size) {
3535
return StringCodec.INSTANCE.getValueDecoder();
3636
}
3737

‎redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/decoder/TDigestDecoder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class TDigestDecoder implements MultiDecoder<TDigestInfo> {
3131
* Field names arrive as bulk strings; decode them as plain strings whatever codec the caller uses.
3232
*/
3333
@Override
34-
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state) {
34+
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state, long size) {
3535
return StringCodec.INSTANCE.getValueDecoder();
3636
}
3737

‎redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/decoder/TopKFilterDecoder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class TopKFilterDecoder implements MultiDecoder<TopKFilterInfo> {
3131
* Field names arrive as bulk strings; decode them as plain strings whatever codec the caller uses.
3232
*/
3333
@Override
34-
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state) {
34+
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state, long size) {
3535
return StringCodec.INSTANCE.getValueDecoder();
3636
}
3737

‎spring-boot-starter/src/main/java/io/github/dengliming/redismodule/springboot/starter/autoconfigure/RedisModuleAutoConfiguration.java‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.springframework.context.annotation.Configuration;
4242
import org.springframework.util.StringUtils;
4343

44-
import java.io.IOException;
4544
import java.util.function.Function;
4645

4746
/**
@@ -156,17 +155,11 @@ private <T extends BaseRedissonClient> T createClient(String module, RedisModule
156155
}
157156

158157
private Config parseRedisModuleConfig(String configStr) {
159-
Config config;
160158
try {
161-
config = Config.fromYAML(configStr);
162-
} catch (IOException e) {
163-
try {
164-
config = Config.fromJSON(configStr);
165-
} catch (IOException ex) {
166-
ex.addSuppressed(e);
167-
throw new IllegalArgumentException("Can't parse config", ex);
168-
}
159+
// YAML is a superset of JSON, so JSON configurations parse as well
160+
return Config.fromYAML(configStr);
161+
} catch (RuntimeException e) {
162+
throw new IllegalArgumentException("Can't parse Redisson config", e);
169163
}
170-
return config;
171164
}
172165
}

‎vectorset/src/main/java/io/github/dengliming/redismodule/vectorset/protocol/decoder/RawVectorDecoder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class RawVectorDecoder implements MultiDecoder<RawVector> {
3838
* The blob must stay binary; every other part is text.
3939
*/
4040
@Override
41-
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state) {
41+
public Decoder<Object> getDecoder(Codec codec, int paramNum, State state, long size) {
4242
if (paramNum == BLOB_INDEX) {
4343
return ByteArrayCodec.INSTANCE.getValueDecoder();
4444
}

0 commit comments

Comments
 (0)