官方文档:http://spring.io/blog/2014/07/08/spring-session-1-0-0-m1-released
1. 优点:
This project provides a number of benefits including:
- Accessing a session from any environment (i.e. web, messaging infrastructure, etc)
- In a web environment
- Support for clustering in a vendor neutral way
- Pluggable strategy for determining the session id
- Easily keep the HttpSession alive when a WebSocket is active
2. 实现:
使用redis集中管理session,jedis作为客户端。
filter拦截request。
结构如下:
具体实现见web目录
3. 小结
对于分布式系统的去session,session集中管理,热部署具有一定的借鉴意义。
微信公众号: 架构师日常笔记 欢迎关注!