You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Session's Hazelcast support relies presence of it's classes in Hazelcast cluster. This isn't a problem with embedded Hazelcast servers, which is the topology most people presumably use, however in more traditional client-server topology this requirement isn't quite user friendly and complicates the maintenance of Hazelcast cluster.
There are two use cases which are responsible for the requirement of Spring Session classes being present in classpath of Hazelcast server:
HazelcastSessionRepository.SessionUpdateEntryProcessor, which is used for updating existing sessions
PrincipalNameExtractor, which is used for retrieving sessions by principal index (i.e. username)
We should improve these use cases to remove the mentioned classpath requirements. Hazelcast offers many serialization related mechanisms, like DataSerializable which could be leveraged to address this.
A nice side-effect of this improvement should also be improved performance, since standard Java serialization isn't the best option there.
As a part of this effort, we should ensure that our integration tests for Hazelcast client-server use case use realistic client-server topology, which isn't the case at present since we start the Hazelcast server that we connect to in the same JVM. This branch contains improved client-server integration tests which use Testcontainers for running Hazelcast server, and also adds a few failing tests that demonstrate the use cases we need to support.
The text was updated successfully, but these errors were encountered:
This has been resolved by refactoring SessionUpdateEntryProcessor from inner static class of HazelcastSessionRepository to a dedicated class. With this change in place, Hazelcast's user code deployment feature can be used as demonstrated in our integration tests:
The use of FindByIndexNameSessionRepository#findByIndexNameAndIndexValue to retrieve sessions still requires presence of Spring Session classes on Hazelcast server, we'll look into possibilities of removing that requirement separately in future releases.
Improving serialization with DataSerializable will also be looked at separately.
Spring Session's Hazelcast support relies presence of it's classes in Hazelcast cluster. This isn't a problem with embedded Hazelcast servers, which is the topology most people presumably use, however in more traditional client-server topology this requirement isn't quite user friendly and complicates the maintenance of Hazelcast cluster.
There are two use cases which are responsible for the requirement of Spring Session classes being present in classpath of Hazelcast server:
HazelcastSessionRepository.SessionUpdateEntryProcessor
, which is used for updating existing sessionsPrincipalNameExtractor
, which is used for retrieving sessions by principal index (i.e. username)We should improve these use cases to remove the mentioned classpath requirements. Hazelcast offers many serialization related mechanisms, like
DataSerializable
which could be leveraged to address this.A nice side-effect of this improvement should also be improved performance, since standard Java serialization isn't the best option there.
As a part of this effort, we should ensure that our integration tests for Hazelcast client-server use case use realistic client-server topology, which isn't the case at present since we start the Hazelcast server that we connect to in the same JVM. This branch contains improved client-server integration tests which use Testcontainers for running Hazelcast server, and also adds a few failing tests that demonstrate the use cases we need to support.
The text was updated successfully, but these errors were encountered: