Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Session Hazelcast should send value objects in serialized form to Hazelcast cluster #3017

Open
OrcunColak opened this issue Jun 7, 2024 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement

Comments

@OrcunColak
Copy link

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

  1. 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

  2. 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

  3. 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

  1. 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

@OrcunColak OrcunColak added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Jun 7, 2024
@OrcunColak OrcunColak changed the title Spring Session Hazelcast should send byte array as attribute value to hazelcast cluster Spring Session Hazelcast should send value objects in serialized form to Hazelcast cluster Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant