【发布时间】:2017-04-02 10:13:01
【问题描述】:
我们正在使用 Spring Cloud 构建一个基于微服务的系统,我们使用 Zuul 作为边缘服务器和一些后端微服务。在其中一个后端服务中,我们使用 Redis 来管理 HttpSession 并存储一些与用户相关的对象。
直接访问微服务时一切正常,但通过 Zuul 访问时出现问题,因为支持微服务总是获得一个新的HttpSession ID。我尝试使用 ZuulFilter 将带有 JSESSIONID 和 SESSION 的 cookie 转发到微服务,但微服务最终没有使用 cookie 值在 Redis 中创建 spring:sessions。
谁能帮助确定如何让 Spring Session 使用 Cookie 值,而不是 HttpSession.ID?
我们正在使用:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
【问题讨论】:
-
你找到答案了吗
标签: spring cookies redis netflix-zuul httpsession