領先一步
VMware 提供培訓和認證,以加速您的進度。
了解更多在 2022 年底,VMware 宣布 Spring for VMware GemFire 專案正式上市。
雖然這些基於 Spring 的 VMware GemFire 專案是開源的,並且是 Spring for Apache Geode 專案的繼任者,但它們並非替代品。 VMware GemFire 是從 Apache Geode 專案分叉出來的,並非開源。
不建議開始使用 Spring for Apache Geode 的新專案,而是轉換到 Spring for VMware GemFire,從這裡開始。 另外,Spring portfolio 提供了與其他同類會話快取供應商的一流整合。 另請參閱這裡。
最後,請記住,Spring for Apache Geode 專案會維護到 OSS 和商業支援結束。 維護僅包括 CVE 和重大修復。 不會新增任何新功能或增強功能。 適用於 Apache Geode 的 Spring Session 支援時間表可以在這裡檢視。
適用於 Apache Geode (SSDG) 的 Spring Session 提供了核心 Spring Session 框架的實現,使用 Apache Geode 來管理使用者的Session資訊。
Session 狀態儲存在 Apache Geode 中,透過利用 Spring Data for Apache Geode。 透過與 Apache Geode 整合,您可以在 Spring Boot 應用程式中充分利用此技術的所有強大功能 (強一致性、低延遲、高可用性、彈性等)。
甚至可以在 Pivotal CloudFoundry 中部署和執行 Spring Boot 應用程式時使用 SSDG,使用 Pivotal Cloud Cache,它本身就是基於 Apache Geode。
適用於 Apache Geode (SSDG) 的 Spring Session 提供以下功能
使用 Apache Geode 作為後端的 HTTP 和 WebSocket Session 狀態管理。
叢集化與分散式 Session 管理 - 提高了系統架構的可用性和彈性。
強一致性 - Apache Geode 實現了強一致性保證,非常像資料庫。
自訂到期策略 - 例如,支援固定的 Session 超時。
自訂資料序列化 - 使 (HTTP) Session 狀態可以透過Java 序列化以外的方式序列化,以便您放入 Session 中的應用程式類別不需要實現 java.io.Serializable
。
自訂變更檢測 - 您可以決定 Session 是否已變更,以及在客戶端/伺服器拓撲中,您的 Spring Boot 應用程式和 Apache Geode 叢集之間傳送的內容 (例如,差異)。
強大的發布/訂閱機制 - 允許您註冊感興趣的項目或表達對 Session 變更的興趣,基於查詢謂詞來接收更新通知。
適用於 Apache Geode 的 Spring Session 是 Maven BOM (物料清單) 的一部分,用於協調整個 Spring Session 專案與此 Apache Geode 擴充之間的版本。 每個 BOM 版本都稱為發布列車,並具有命名策略,例如:Apple-SR9
、Bean-SR12
、Corn-SR6
、Dragonfruit-SR3
、2020.0.7
、2021.0.4
、2021.1.1
、2021.2.0-M1
和 2022.0.0-M1
。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-bom</artifactId>
<version>2021.1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
然後,您可以將 BOM 作為依賴項新增到您的 Spring Boot 應用程式 Maven POM 檔案中
<dependencies>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-geode</artifactId>
</dependency>
</dependencies>
由於 Gradle 對 Maven BOM 沒有一流的支援,因此您可以使用 Spring 的 Dependency Management Plugin。
從 Gradle Plugin Portal 應用外掛程式 (如果需要,更新版本)
plugins {
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}
然後使用它來匯入 BOM
dependencyManagement {
imports {
mavenBom 'org.springframework.session:spring-session-bom:2021.1.1'
}
}
最後,將依賴項新增到專案,而無需版本
dependencies {
compile 'org.springframework.session:spring-session-data-geode'
}