升级Redisson版本兼容问题

升级版本:从 3.10.6 升级到3.18.0

报错: java.io.IOException: Unsupported protocol version 252
复制代码
java.io.IOException: Unsupported protocol version 252
        at org.jboss.marshalling.river.RiverUnmarshaller.start(RiverUnmarshaller.java:1375)
        at org.redisson.codec.MarshallingCodec.lambda$new$0(MarshallingCodec.java:145)
        at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:383)
        at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:198)
        at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:137)
        at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:113)
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507)
        at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:750)
问题原因:

版本: 3.10.6 默认使用了FstCodec 编码

3.18.0 默认编码使用:MarshallingCodec,官方已经明确不再建议使用 FstCodec编码,并且移除了Fst相关依赖

若希望继续兼容老的编码方式,进行以下步骤:

XML 复制代码
<dependency>
    <groupId>de.ruedigermoeller</groupId>
    <artifactId>fst</artifactId>
    <version>2.57</version>
</dependency>

增加自定义编码

java 复制代码
@Bean
public RedissonAutoConfigurationCustomizer redissonAutoConfigurationCustomizer(){
    return config -> {
        config.setCodec(new FstCodec());
    };
}
相关推荐
wydaicls3 分钟前
十一.C++ 类 -- 面向对象思想
开发语言·c++
Biomamba生信基地36 分钟前
R语言基础| 下载、安装
开发语言·r语言·生信·医药
姜君竹37 分钟前
QT的工程文件.pro文件
开发语言·c++·qt·系统架构
奇树谦41 分钟前
使用VTK还是OpenGL集成到qt程序里哪个好?
开发语言·qt
Angel_girl31943 分钟前
vue项目使用svg图标
前端·vue.js
難釋懷1 小时前
vue 项目中常用的 2 个 Ajax 库
前端·vue.js·ajax
Qian Xiaoo1 小时前
Ajax入门
前端·ajax·okhttp
VBA63371 小时前
VBA之Word应用第三章第十节:文档Document对象的方法(三)
开发语言
老胖闲聊1 小时前
Python Rio 【图像处理】库简介
开发语言·图像处理·python
爱生活的苏苏1 小时前
vue生成二维码图片+文字说明
前端·vue.js