-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Support for Hazelcast 4 #1584
Comments
I've forked the repo, upgraded the hazelcast dependencies, and fixed the code so that it compiles, but there's a failing integration test, |
@fisco-unimatic Thanks for looking at this issue. |
Another option is ensuring that we can work with both versions of Hazelcast. |
Spring Sessions 2.4+ can support Hazelcast 4+. This can be documented so that everyone can be aware of compatibility requirement. |
We can add support for Hazelcast 4, but we must continue to support Hazelcast 3. Our tests should verify that it continues to work as well. |
@mesutcelik Spring Session primarily has to align with Spring Boot in terms of managed dependency versions, and since Spring Boot manages those taking semver into account, it's unlikely that upgrade to Hazelcast 4.x will happen before Spring Boot 3.0 It is unfortunate that Hazelcast opted to do so many breaking changes in 4.0 release without ensuring users have a smooth transition period by keeping the old APIs in deprecated form for some time. |
@vpavic Thanks for the feedback. A major release had to be done at some point. Every product does that but good news is that 3.12 will be actively supported and this support can be considered as deprecation policy. See active branches for 3.x Hazelcast has also clear Migration Guide for the documentation of breaking changes. In terms of SpringBoot compatibility, Spring Boot 2.2.x works fine with Hazelcast 4 except Spring Boot Actuator. Micrometer needs to give Hazelcast 4 Support first. Once that is resolved then Hazelcast Dependency can be upgraded to 4.x |
There is a similar issue in the Spring Boot repository, spring-projects/spring-boot#20856, which the team has tackled by offering best effort support for Hazelcast 4, spring-projects/spring-boot#21169. This means that if a user decides to override the dependency management and use Hazelcast 4, they will have some functionality, but likely not full support. Spring Session could make similar changes in order to offer best effort support for Hazelcast 4, while still maintaining full support for Hazelcast 3. |
@eleftherias we are considering moving to Hazelcast 4 with Spring Boot 2.4. We will keep compatibility with Hazelcast 3.x but a default Spring Boot 2.4 app would bring Hazelcast 4. I am not keen to proceed until we have some visibility on this particular issue. Based on another comment of yours it looks like this is scheduled. Can you please clarify? |
Thanks for pointing that out @snicoll. I have corrected the milestone on this issue to |
Thanks @eleftherias. Is there an ETA for a snapshot that includes this fix? I'd like to upgrade but I can't until Spring Session has (optional) support for it. Thanks! |
@snicoll I plan to have a snapshot that includes a fix at the end of next week or the beginning of the following week so that it is ready in time for RC1. |
Configuring a Hazelcast instance requires Hazelcast 4 specific classes. @Bean static HazelcastInstance hazelcastInstance() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.setPort(0); networkConfig.getJoin().getMulticastConfig().setEnabled(false); AttributeConfig attributeConfig = new AttributeConfig() .setName(Hazelcast4IndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE) .setExtractorClassName(Hazelcast4PrincipalNameExtractor.class.getName()); config.getMapConfig(Hazelcast4IndexedSessionRepository.DEFAULT_SESSION_MAP_NAME) .addAttributeConfig(attributeConfig).addIndexConfig( new IndexConfig(IndexType.HASH, Hazelcast4IndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)); SerializerConfig serializerConfig = new SerializerConfig(); serializerConfig.setImplementation(new HazelcastSessionSerializer()).setTypeClass(MapSession.class); config.getSerializationConfig().addSerializerConfig(serializerConfig); return Hazelcast.newHazelcastInstance(config); } |
@snicoll The latest snapshot has the optional support for Hazelcast 4. |
@eleftherias thanks for the follow-up. Unfortunately, I can't test the change as the bom currently points to milestone 1 (I've created #1685). The changes look rather involved on the Spring Boot side of things. Do I understand that if Spring Session uses Hazelcast 4
|
@snicoll I updated the BOM to use snapshots. You are right about the changes involved to configure a Even aside from the Spring Session changes, the |
Hazelcast 4 has recently been released and it is not currently supported.
related : https://stackoverflow.com/questions/60303477/spring-session-with-hazlecast-4
The text was updated successfully, but these errors were encountered: