spring-session-data-redis使用codis連接時報錯

spring-session-data-redis整合codis問題
1、錯誤:Unable to configure Redis to keyspace notifications
原因:codis不支持config,notify-keyspace-events等操作
解決方法:添加bean

@Bean
ConfigureRedisAction configureRedisAction() {
	return ConfigureRedisAction.NO_OP;
}

來源:

https://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisindexedsessionrepository-sessiondestroyedevent
If you use @EnableRedisHttpSession, managing the
SessionMessageListener and enabling the necessary Redis Keyspace
events is done automatically. However, in a secured Redis enviornment,
the config command is disabled. This means that Spring Session cannot
configure Redis Keyspace events for you. To disable the automatic
configuration, add ConfigureRedisAction.NO_OP as a bean.

待定

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章