求助 spring cloud 长时间不操作 redis 报错

2018-08-09 09:04:29 +08:00
 findbrick

报错信息: nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.

使用的是:spring-boot-starter-data-redis redistemplate

redis timeout 配置:10 秒钟

解决方案: redis timeout 设置为 0 即不超时

不知道 properties 是否有可以配置保持连接的参数

2024 次点击
所在节点    程序员
2 条回复
zjp
2018-08-09 10:08:18 +08:00
用连接池
letitbesqzr
2018-08-09 17:00:34 +08:00
检查下网络连接 以及 redis 的状态吧,spring-boot-starter-data-redis 使用了 commons-pool2 当连接池

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/478129

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX