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.
待定