I have Spring Boot application which binds with ClearDb(MySQL) and Redis Cloud as a backing store. My application will create an simple account and stores in MySQL. I have used spring-session-data-redis
to store HttpSession
session attributes into Redis cloud. I can able to store all session attributes into Redis Cloud.
In manifest.yml
file, I mentioned instances
to 2. Once App gets started with 2 instances, session replication works between app's instances. When I do scale out process to app's instance to 3. Newly created instance started receiving traffic but when It tried to get session information it throws NullPointerException
and shows response code 500
with error message as Internal Server Error
. It seems session replication is not working on 3rd app's instance and session replication not working on scaling app's instances though.
How can I resolve this issue? Any help much appreciated!
Issue has solved. It is because HttpSession
is not autowired to use in other methods in controller class.