遥遥领先
VMware 提供培训和认证,以加速您的进步。
了解更多我很高兴代表 Spring 和 Apache Geode 社区宣布发布适用于 Apache Geode 和 Pivotal GemFire 的 Spring Session (SSDG) 2.1.4.RELEASE
和 2.2.0.M2
版本。
SSDG 2.1.4.RELEASE
和 2.2.0.M2
现在都支持关闭客户端订阅的功能。 SSDG 不再需要启用客户端订阅才能使用 Apache Geode 或 Pivotal GemFire 来管理您的 HTTP Session 状态。 但是,如果未显式启用客户端订阅,则客户端将不再收到可能源自访问同一 (HTTP) Session 的其他客户端的 Session 事件通知。 这在负载平衡、非粘性 Session 环境中是完全可能的。
此外,SSDG 2.2.0.M2
添加了一个新的 Session 事件 SessionChangedEvent
,用于在 Session 状态更改时(例如,已更新)通知“感兴趣的”客户端。 Session 更改事件实际上不是 Spring Session 核心的一部分,而是 Apache Geode 和 Pivotal GemFire 支持的一项功能。 这在客户端想要知道 Session 状态是否已更改的情况下可能很有用,尤其是在高度并发的环境中。 当然,这仅在启用客户端订阅时有效。
作为提醒,您可以使用以下配置启用客户端订阅
在“DEFAULT”池上启用客户端订阅
@ClientCacheApplication(subscriptionEnabled = true)
@EnableGemFireHttpSession(poolName = "DEFAULT")
class SpringSessionUsingApacheGeodeConfiguration { ... }
此外,如果您已配置专用的、命名的连接Pool
供 SSDG 使用,那么您的配置将类似于
在目标池上启用客户端订阅
@ClientCacheApplication
@EnablePool(name = "SessionPool", subscriptionEnabled = true)
@EnableGemFireHttpSession(poolName = "SessionPool")
class SpringSessionUsingApacheGeodeConfiguration { ... }
SSDG 2.1.4.RELEASE
版本可在 Maven Central 中找到,SSDG 2.2.0.M2
版本可在 Spring libs-milestone
存储库中找到。
此外,这两个版本都将在即将发布的 Spring Boot 2.1.6.RELEASE
和 Spring Boot 2.2.0.M4
版本中分别获得。
一如既往,我们欢迎您的反馈。 请尝试新版本,让我们知道您的想法。
问题 | PR | StackOverflow