lettuceconnectionfactory与sentineltopologyprovider

e37o9pze  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(232)

我正在通过springbootapi使用莴苣 org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory .
我的bean配置为

@Bean
public LettuceConnectionFactory lettuceSentinelConnectionFactory() {
        RedisSentinelConfiguration sentinelConfig = new RedisSentinelConfiguration(mastername, new HashSet<>(sentinelnodes));
        return new LettuceConnectionFactory(sentinelConfig);
    }

这可以正常工作,除了在拓扑更改后重新连接,从而导致异常。

io.lettuce.core.RedisCommandExecutionException: READONLY You can't write against a read only slave.

一些错误报告似乎证实了这种行为。
我非常感兴趣地读到,莴苣为sentinels sentineltopologyprovider实现了一个动态拓扑发现器,它应该能够很好地解决这个问题。
然而,我无法使莴苣连接工厂使用这个动态sentinelTopology提供程序,谷歌也没有返回任何东西。
有人能给出一个提示或一些关于如何编写这个代码的示例代码吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题