Previously, invoking HttpServletRequest#changeSessionId on session backed by HazelcastSessionRepository generated generated invalid session destroyed and session created events. This was due to use of IMap#remove and IMap#set when handling the change session id.
This commit improves change session id handling to prevent publishing invalid events by using IMap#delete instead of IMap#remove and keeping track of originally assigned session id.
Closes gh-1077
This commit improves HazelcastSessionRepository.SessionUpdateEntryProcessor to avoid NPE in scenario where save operation was invoked for session that was already deleted.
See gh-1076
This commit introduces several optimizations to write operations in `HazelcastSessionRepository`.
- when storing a new session, `IMap#set` is now used instead of `IMap#put`
- when updating an existing session, `IMap#executeOnKey` and a dedicated `EntryProcessor` are used
To make these two changes possible, internal `HazelcastSession` now adds a flag to determine which of the two mentioned write scenarios to use, and also tracks a delta of session attributes in order to optimize updates.
Closes gh-850
This commit improves Hazelcast configuration by introducing `@SpringSessionHazelcastInstance` qualifier for explicitly declaring a `HazelcastInstance` to be used by Spring Session. This is in particular useful in scenarios with multiple `HazelcastInstance` beans present in the application context.
Closes gh-912
This commit improves dependency management with the following changes:
- `spring-session-core`: move `javax.servlet-api` from `provided` to `optional` configuration due to introduction of reactive support
- `spring-session-data-redis`: remove Redis driver from `compile` configuration
- Boot samples: delegate Redis driver choice to `spring-boot-starter-data-redis`
- polish `test` configuration dependencies
This commit improves existing Hazelcast support, which is based on
MapSessionRepository, with dedicated HazelcastSessionRepository
that implements the FindByIndexNameSessionRepository contract.
Also a new hazelcast-spring-session module was added to provide
dependency management for Hazelcast support.
Fixes gh-544