Redis server response timeout (3000 ms) occured after 3 retry attempts. Command: (EXISTS), params: [
Redis server response timeout (3000 ms) occured after 3 retry attempts. Command: (EXISTS), params: [XXXX], channel: [id: 0xXXXX, L:/XXXXX.45.128:44772 - R:10.122.67.XX/10.122.67.56:6379]X
rg.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms) occured after 3 retry attempts. Command: (HEXISTS), params: [com.dinsmooth.storehbase.schedule:entryTaskDelay, 1f15dcac-22b6-4865-92a5-a6452e6ae5c3:154], channel: [id: 0x4d120152, L:/10.255.2.30:52607 - R:172.16.0.211/172.16.0.211:6379] at org.redisson.command.RedisExecutorHashedWheelTimeout.expire(HashedWheelTimer.java:682) at io.netty.util.HashedWheelTimerWorker.run(HashedWheelTimer.java:485) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748)
误原因:客户端长时间未使用,服务端会断开
解决办法:redisson添加配置
#连接间隔 心跳 pingConnectionInterval: 1000
使用代码配置:
package io.lenovo.ecai.portalorder.config; import org.redisson.Redisson; import org.redisson.api.RedissonClient; import org.redisson.config.Config; import org.redisson.spring.data.connection.RedissonConnectionFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RedissonConfig { /** * 设置redisson缓存工厂,由于下面的工厂都是用的是redisson所以注意配置redissonclient * * @param client * @return */ @Bean(name = "redissonconnectionfactory") public RedissonConnectionFactory getfactory(RedissonClient client) { return new RedissonConnectionFactory(client); } /** * redis单机配置 * * @return */ public RedissonClient getclient() { Config config = new Config(); config.useSingleServer().setAddress("redis://${spring.redis.host}:${spring.redis.port}") .setTimeout(1000) .setRetryAttempts(3) .setRetryInterval(1000) .setPingConnectionInterval(1000)//**此项务必设置为redisson解决之前bug的timeout问题关键***** .setDatabase(3); return Redisson.create(config); } }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2012-01-12 财务术语解释