If what you want to do is set Jedis connection timeout, you should do it using the special constructor made for that:public Jedis(final String host, final int port, final int timeout)您正在做的是在 jedis 的redis设置中设置超时.进行 CONFIG SET timeout 60 (配置超时60),意味着redis将在 60 秒后关闭空闲的客户端连接.这就是为什么您在Jedis中遇到例外的原因.What you are doing is setting the timeout on redis settings from jedis. Doing CONFIG SET timeout 60, means that redis will close idle client connections after 60 seconds. That's why you get the exception in Jedis. 这篇关于配置Jedis超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-22 22:51