spring-projects / spring-projects/spring-session
Spring Session Hazelcast should send value objects in serialized form to Hazelcast cluster
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Expected Behavior
org.springframework.session.hazelcast.SessionUpdateEntryProcessor class should store attributes as
private Map<String, com.hazelcast.internal.serialization.Data> delta;
This allows SessionUpdateEntryProcessor to be serialized and sent to Hazelcast cluster without the cluster knowing the actual value type. Essentially this means that Spring should send value objects in serialized form
Current Behavior
Currently org.springframework.session.hazelcast.SessionUpdateEntryProcessor class is storing attributes as
private Map<String, Object> delta;
When SessionUpdateEntryProcessor sent to cluster, it is deserialized by Hazelcast. But Hazelcast does not have to have my value object in its classpath and this causes deserialization exceptions on the cluster member
Context
-
How has this issue affected you?
Currently I am not able to put classes that are not on the classpath of cluster member to session. I need to add all my classes to member's classpath or deploy it from client side via "user code deployment" feature -
What are you trying to accomplish?
I am trying to accomplish the same functionality as https://github.com/hazelcast/hazelcast-wm/ project. This project is provided by hazelcast and sending value objects as com.hazelcast.internal.serialization.Data. Neverthless I would like to see the same functionality provided by Spring Session -
What other alternatives have you considered?
There are two alternatives
a. Hazelcast Client mode - With "User code deployment" feature deploy all value objects to cluster
b. Add all value objects to cluster classpath
Both alternatives are cumbersome
- Are you aware of any workarounds?
There is a solution in this question.
https://stackoverflow.com/questions/78581753/problem-with-httpsession-serialization-classnotfoundexception-after-migration/78585830?noredirect=1#comment138548109_78585830
The user has forked hazelcast-wm project anf changed all dependencies. But that is unnecessary work
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with org.springframework.session.hazelcast.SessionUpdateEntryProcessor and inspect how its delta map is serialized and sent to the Hazelcast cluster. Compare the expected Data-based representation with the current Object-based one, then verify that session attributes whose classes are absent from the cluster member classpath can be handled without deserialization exceptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100