spring-session icon indicating copy to clipboard operation
spring-session copied to clipboard

Hazelcast implementation of `ReactiveSessionRepository`

Open vpavic opened this issue 8 years ago • 6 comments

We should provide a Hazelcast based implementation of ReactiveSessionRepository.

vpavic avatar Jul 12 '17 22:07 vpavic

While Hazelcast currently has reactive support, it is based on its own ICompletableFuture which extends from Future and not CompletableFuture since Hazelcast 3.x maintains compatibility with Java 6.

The plan is to replace ICompletableFuture with CompletableFuture in Hazelcast 4.0 when Java 8 becomes baseline - see hazelcast/hazelcast#3622.

Perhaps we should hold off our efforts of providing Hazelcast backed ReactorSessionRepository until Hazelcast 4.0 becomes available (ATM there's no target date for the milestone). WDYT @rwinch?

vpavic avatar Aug 03 '17 17:08 vpavic

The hazelcast itself have Spring integration in the hazelcast core, I am not sure if it works when implementing a custom MapReactiveSessionRepository with a hazelcast managed Map as the constructor arguments ?

hantsy avatar Nov 12 '17 10:11 hantsy

Looks like the dependent change didn't make it into the hazelcast 4 release

d3bbrower avatar Mar 27 '20 21:03 d3bbrower

Hi @vpavic @eleftherias, I have implemented a ReactiveSessionRepository based on Hazelcast (following the general approach of the existing non-reactive Hazelcast4 session repo and reusing the existing entry processor) and was wondering if I should integrate this with Spring? I am a bit short on time at the moment and not sure if I can provide a full pull request. But I could at least publish my branch and let others fork from it and complete it, if you think that is worth it.

Hazelcast 4.2.4 returns CompletionStage from its async IMap methods, so the integration with the reactor chain is not that complicated. My solution does not support FlushMode because I don't see a good way how to properly implement immediate flushing via async saves in blocking methods like session.setAttribute(). And the FindByIndexNameSessionRepository interface is also not reactive and thus I omitted it.

Thanks for your feedback.

AndreasKasparek avatar Jan 21 '22 15:01 AndreasKasparek

Thanks @AndreasKasparek.

We're still planning to wait on hazelcast/hazelcast#3622 before we add this feature to Spring Session. We want to make sure we can provide users with the full functionality of Spring Session and Hazelcast, rather than adding a partial solution.

For anyone that is waiting on this feature please continue to show your interest by upvoting this issue, as well as hazelcast/hazelcast#3622 which is currently scheduled for Hazelcast 6.

eleftherias avatar Jan 21 '22 16:01 eleftherias

@eleftherias Just to be clear, what are the features that cannot be implemented with IMap’s async methods and would require https://github.com/hazelcast/hazelcast/issues/3622 ?

That ticket is 8 years old, it has been postponed to Hazelcast 6 now and does not look like it is going to be implemented any time soon… Moreover it is about changes to IExecutorService, what is needed from it? When I look at the Redis implementation it does not seem to require a similar service.

(I’m not familiar with the topic, I’m just trying to understand the issue)

DidierLoiseau avatar Nov 25 '22 19:11 DidierLoiseau