Cannot find a working configuration for Http Session replication in Grails 4

104 Views Asked by At

I wanted to run my Grails application (version 4.0.4) in a cluster. I tried to apply Hazelcast to replicate the HTTP session across the nodes/instances but somehow I couldn’t override/replace the SessionRepository bean that Grails uses with the Hazelcast implementation.

My working configuration in Spring Boot is: I declare the Hazelcast bean and annotate the Application with @EnableHazelcastHttpSession which in turn introduces the new SessionRepository from Hazelcast.

But I couldn’t make this configuration work in Grails and override the SessionRepository. (Although the app starts, it acts very strange.)

Any ideas? Or do you suggest an alternative approach to implement a distributed session in Grails? How did you replicate session from your past experience?

(P.S The reason I chose Hazelcast is, since it is a distributed cache which can be embedded with the application itself, I can avoid dependency on external service such as Redis, to run the app. That is part of the requirement).

Thank you.

0

There are 0 best solutions below