In the flexible environment, App Engine doesn’t provide built-in support for distributed sessions like it does in the standard environment with Memcache.
So after migrating to Flex, I am unable to autoscale the application anymore as the user session cannot be routed from an instance to another like it was in Standard.
We should specify a Session Storage (eg: Redis) to have the user sessions shared between all the instances.
I looked at this google documentation https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml but it didn’t helped me.
Any ideas ?
2
Answers
Spring Session makes it very simple !
Include the
spring-session-core
&spring-session-data-redis
libraries into yourpom.xml
fileConfigure your redis configuration. 2 ways exist here
Put the below into your
application.properties
Spring will automatically create the session in redis instead of the memory store as shown below
Sharing this as a community wiki for the benefit of others
As mentioned by @minou