Spring Session for Apache Geode & Pivotal GemFire (SSDG) provides an API and implementation of Spring Session core to manage a user’s Session information.
Session state is stored in Apache Geode by leveraging Spring Data for Apache Geode, or Pivotal GemFire by leveraging Spring Data for Pivotal GemFire. By integrating with Apache Geode and Pivotal GemFire, you now have the power of these technologies (e.g. Strong Consistency, Low Latency, High Availability, Resiliency, etc) at your finger tips in your Spring Boot applications.
It is even possible to use SSDG when deploying and running your Spring Boot applications in Pivotal CloudFoundry, using Pivotal Cloud Cache, which is itself based on Apache Geode.
Spring Session for Apache Geode, or alternatively Pivotal GemFire, (SSDG) provides the following features:
HTTP and WebSocket Session state management using either Apache Geode or Pivotal GemFire as the backend. Clustered & Distributed Session Management - Improves on the availability and resilience of your system architecture. Strong Consistency - Both Apache Geode & Pivotal GemFire implement strong consistency guarantees, much like a database. Custom Expiration Policies - E.g. support for fixed Session timeouts Custom Data Serialization - Enable the (HTTP) Session state to be serialized other than by Java Serialization so that application classes you put into the Session do not need to implement java.io.Serializable. Custom Change Detection - You can decide whether the Session is dirty or not and what gets sent (e.g. the delta) between your Spring Boot application and the Apache Geode cluster in a client/server topology. Powerful Pub/Sub mechanics - Allow you to register interests or express interests in Session changes based on a query predicate to receive notifications of updates, etc.
Adding Spring Session for Apache Geode or Pivotal GemFire to you build
Spring Session for Apache Geode & Pivotal GemFire is part of a Maven BOM (Bill of Materials) used to coordinate versions between the core Spring Session projects and this GemFire/Geode extension. Each BOM release is called a release train and has a naming strategy, e.g. Apple-SR9, Bean-SR7, Corn-M4, etc.
Using the BOM with Maven
Then you can add the BOM as a dependency to your Spring Boot application Maven POM file:org.springframework.session spring-session-data-geode
Using the BOM with Gradle
Since Gradle has no first-class support for Maven BOMs, you can use Spring’s Dependency Management Plugin.
Apply the plugin from Gradle Plugin Portal (update the version if needed):
id ‘io.spring.dependency-management’ version ‘1.0.6.RELEASE’
Then use it to import the BOM:
Finally, add a dependency to the project without a version:
Spring Boot Config
If you are using Spring Boot, and specifically, Spring Boot for Apache Geode & Pivotal GemFire (SBDG), you can include the starter for Spring Session for Apache Geode (SSDG) in your Spring Boot application Maven POM file.
For example:org.springframework.geode spring-geode-starter-session 1.1.0.RELEASE
To change to using Pivotal GemFire, you only need to change the artifactId from spring-geode-starter-session to spring-gemfire-starter-session. The version number stays the same for which ever version you are using.
See the SBDG Version Compatibility Matrix for more details.
Quickstart Your Project
Bootstrap your application with Spring Initializr.