spring-projects / spring-projects/spring-session
Spring session websocket example not running across multiple Tomcat servers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
I am testing clustering of the spring sessions websocket sample.
I'm running the sample as described in docs: http://docs.spring.io/spring-session/docs/current/reference/html5/guides/websocket.html. Code from: https://github.com/spring-projects/spring-session/archive/1.2.2.RELEASE.zip.
If I run two browser sessions against the app on one Tomcat server, all works as expected. but If I run the app on each of two servers I don't get the results I expect.
I start the app on two servers and login as Rob on one and Luke on the other. Rob comes up first as expected with no chat users listed. Then Luke comes up but does not list Rob as a chat user. Rob then detects Luke and lists Luke as a chat user.
Also, if I refresh the web page for Rob the user goes away and Rob is added to the list for Luke. This cycle continues back and forth.
It looks like spring sessions is sharing session info. I see entries in Redis for both logins.
Should I expect this sample to run across multiple servers?
thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Spring Session WebSocket guide and the 1.2.2.RELEASE sample, then reproduce the behavior with two Tomcat servers and two browser sessions. Compare the Redis session entries and user-list updates across refreshes; done means the sample's expected multi-server behavior is established and the guide or sample accurately reflects it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, redis, spring
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100