关注此问题Spring Zuul API Gateway with Spring Session / Redis Authenticate and Route in same Request
我试图将会话存储到单独的Redis服务器中。 这是我的网关的POM
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session</artifactId>
<version>1.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
我添加了此注释
@EnableRedisHttpSession(redisFlushMode = RedisFlushMode.IMMEDIATE)
和这些豆子
@Bean
LettuceConnectionFactory lettuceConnectionFactory() {
return new LettuceConnectionFactory();
}
@Bean
public static ConfigureRedisAction configureRedisAction() {
return ConfigureRedisAction.NO_OP;
}
不幸的是,当我在redis-cli中执行*键时,尽管我为会话设置了一些属性,但我什么都没有存储。 我想念什么吗?