RedisStaticMasterReplicaConfiguration不支持发布/订阅,因为缺少在各个服务器之间传播的发布/订阅消息

问题描述

我想将select id,max(case when rn = 1 then value end) value1,max(case when rn = 2 then value end) value2,max(case when rn = 3 then value end) value3 from ( select id,value,row_number() over(partition by id order by value) rn from mytable ) t group by id 应用于我的spring-session-data-redis项目。

但打印了日志spring boot

例外消息为Connection failure occurred. Restarting subscription task after 5000 ms

我的redis配置是

Pub/Sub connections not supported with Master/Replica configurations

public LettuceConnectionFactory lettuceConnectionFactory() { RedisStaticMasterReplicaConfiguration configuration = new RedisStaticMasterReplicaConfiguration( MASTER_HOST,MASTER_PORT); configuration.addNode(SLAVE_HOST,SLAVE_PORT); LettuceClientConfiguration clientConfig = LettuceClientConfiguration.builder().readFrom(ReadFrom.REPLICA_PREFERRED).build(); return new LettuceConnectionFactory(configuration,clientConfig); } 环境中开发。 我的redis环境是写到主数据库,从副本中读取

因此,我们根据以下文档应用了aws

对于通过INFO报告非公共地址的环境 命令(例如,使用AWS时),请使用 RedisStaticMasterReplicaConfiguration代替 RedisStandaloneConfiguration。

但是,根据下面的文档,它不支持RedisStaticMasterReplicaConfiguration

请注意,RedisStaticMasterReplicaConfiguration不会 由于缺少发布之间的发布/订阅消息传播,因此支持发布/订阅 单个服务器。

有什么好主意吗?

奇怪的是

打印日志Pub/Sub

但是,它运行良好。(在Connection failure occurred. Restarting subscription task after 5000 ms中保存并选择会话)

其他信息:

以此尝试连接redis

Pub/Sub

org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration

解决方法

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

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...