Lettuce API 进入周期性 TimeoutException 问题

问题描述

我们有 10 个节点(5 个主节点,5 个只读副本)AWS Redis 集群。我们使用生菜 API。我们正在使用 Lettuce API 非池配置和异步调用。几乎每周我们都会遇到一个问题,我们会在几分钟内收到连续的 TimoutExceptions。我们预计这是一个网络问题,但网络团队没有发现网络问题。可能的解决方案是什么?

private LettuceConfigWithoutPool(RedisClusterConfig pool) {
    if (lettuceConfigWithoutPoolInstance != null) {
        throw new RuntimeException("Use getInstance() method to get the single instance of this class.");
    }
    List<RedisURI> redisURIS = new RedisURIBuilder.Builder(pool)
            .withPassword()
            .withTLS()
            .build();

    ClusterTopologyRefreshOptions clusterTopologyRefreshOptions = new ClusterTopologyBuilder.Builder(pool)
            .setAdaptiveRefreshTriggersTimeoutInMinutes()
            .build();

    ClusterClientOptions clusterClientOptions = ClusterClientOptions.builder()
            .topologyRefreshOptions(clusterTopologyRefreshOptions)
            .build();
    RedisClusterClient redisClusterClient = ClusterClientProvider.buildClusterClient(redisURIS,clusterClientOptions);
    StatefulRedisClusterConnection<String,Object> statefulRedisClusterConnection = redisClusterClient.connect(new SerializedobjectCodec());

    statefulRedisClusterConnection.setReadFrom(ReadFromArgumentProvider.getReadFromArgument(pool.getReadFrom()));
    this.command = statefulRedisClusterConnection.async();

    
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)