使用spring session redis实现共享session之后,httpsession监听失效 redisspringhttpsessionsessionSessionDestroyedEvent
程序员文章站
2022-04-24 17:19:02
...
原因是配置了:
参考官网文章:
https://docs.spring.io/spring-session/docs/1.1.0.M1/reference/html5/#httpsession-httpsessionlistener
看到这样的一段:
解决办法:
去掉配置:
如果还不行,那就需要开启redis的key失效事件监听。
参考文章:http://blog.csdn.net/aeroleo/article/details/77011839
<util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>这一行。
参考官网文章:
https://docs.spring.io/spring-session/docs/1.1.0.M1/reference/html5/#httpsession-httpsessionlistener
看到这样的一段:
引用
If you are using @EnableRedisHttpSession 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.
解决办法:
去掉配置:
<util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
如果还不行,那就需要开启redis的key失效事件监听。
参考文章:http://blog.csdn.net/aeroleo/article/details/77011839
上一篇: Eureka服务注册不可用问题