小编Lak*_*nth的帖子

io.lettuce.core.RedisCommandTimeoutException:命令超时

io.lettuce.core.RedisCommandTimeoutException: Command timed out after 10 second(s)
    at io.lettuce.core.ExceptionFactory.createTimeoutException(ExceptionFactory.java:51) ~[lettuce-core-5.1.6.RELEASE.jar:?]
    at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:114) ~[lettuce-core-5.1.6.RELEASE.jar:?]
    at io.lettuce.core.cluster.ClusterFutureSyncInvocationHandler.handleInvocation(ClusterFutureSyncInvocationHandler.java:123) ~[lettuce-core-5.1.6.RELEASE.jar:?]
    at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) ~[lettuce-core-5.1.6.RELEASE.jar:?]
    at com.sun.proxy.$Proxy72.get(Unknown Source) ~[?:?]
    at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
    at io.lettuce.core.support.ConnectionWrapping$DelegateCloseToConnectionInvocationHandler.handleInvocation(ConnectionWrapping.java:191) ~[lettuce-core-5.1.6.RELEASE.jar:?]
    at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) ~[lettuce-core-5.1.6.RELEASE.jar:?]
    at com.sun.proxy.$Proxy72.get(Unknown Source) ~[?:?]
Run Code Online (Sandbox Code Playgroud)

我正在使用以下示例代码通过连接池获取连接,请检查并建议我做错了什么

public StatefulRedisClusterConnection<String, String> getRedisClient() {
        log.debug("getRedisClient()");
        if (pool == null) {
            synchronized (this) {
                pool = initializeConnectionPool();
            }
        }
        try {
            return pool.borrowObject();
        } catch (Exception e) {
            log.error("getting pool connection failed",e);
        }
        return null;
    } …
Run Code Online (Sandbox Code Playgroud)

lettuce amazon-elasticache redis-cluster

6
推荐指数
1
解决办法
3817
查看次数