Skip to content

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

Open
@OrcunColak

Description

@OrcunColak

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions