升级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());
    };
}
相关推荐
m0_470857641 分钟前
如何制作并发布自己的phpMyAdmin主题_主题结构解析与打包分享的开发者指南
jvm·数据库·python
无风听海4 分钟前
OAuth 2.0 response_type完全指南
java·开发语言·oauth
Cyan_RA94 分钟前
SpringMVC 数据格式化处理 详解
java·开发语言·spring·mvc·ssm·springmvc·数据格式化
2303_821287385 分钟前
怎么在MongoDB中追踪一个Document的具体流转路径_从Chunk分布到迁移历史日志分析
jvm·数据库·python
测试员周周5 分钟前
【Appium 系列】第08节-pytest 集成 — conftest.py 中的 fixture 与 hook
开发语言·人工智能·python·功能测试·appium·测试用例·pytest
SunnyDays10116 分钟前
如何使用 Python 删除 Word 文档密码和保护
python·删除 word 文档密码·移除 word 文档保护·解密 word 文档
Hui_AI7208 分钟前
电商桌面自动化实战:用RPA实现抖店批量铺货
运维·开发语言·人工智能·自然语言处理·自动化·开源软件·rpa
weixin_459753949 分钟前
mysql如何批量重置数据库用户密码_MySQL批量修改密码Shell脚本
jvm·数据库·python
人道领域9 分钟前
【LeetCode刷题日记】递归与回溯实战 257.二叉树的所有路径——一篇文章彻底搞懂回溯
开发语言·python·算法·leetcode
Gofarlic_OMS11 分钟前
Mastercam浮动许可利用率低:软件许可浪费,回收再分配
java·大数据·开发语言·架构·制造