简体   繁体   中英

Session Replication issue between Cloud Foundry app instances after Scaling app's instance

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM