Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stomp SockJS Client disconnect periodically #1

Closed
aminmc opened this issue Oct 18, 2018 · 5 comments
Closed

Stomp SockJS Client disconnect periodically #1

aminmc opened this issue Oct 18, 2018 · 5 comments
Labels
question Further information is requested

Comments

@aminmc
Copy link

aminmc commented Oct 18, 2018

Hi there,

I have a spring boot app with WebSocket configured and using Redis. When I have multiple instances of the spring boot app I've noticed that my client disconnects periodically. Is this something you have encountered?
This is my WebSocket configuration:
https://github.com/UKHomeOffice/borders-private-workflow-engine/blob/development/src/main/java/uk/gov/homeoffice/borders/workflow/task/TaskWebSocketConfig.java

Any help would be appreciated.

@RawSanj
Copy link
Owner

RawSanj commented Oct 22, 2018

Hi @aminmc, I haven't came across this probably because I never connected long enough.
Can you help me with the time period client disconnects?
I'll look look into it if the same happens with mine.

@aminmc
Copy link
Author

aminmc commented Oct 22, 2018

Hi there

My client gets disconnected every 60 seconds.

Thanks

@RawSanj
Copy link
Owner

RawSanj commented Oct 23, 2018

@aminmc I tested my setup, I don't face any issues. I kept my app running and sending text, didn't see any disconnect.

Check if you are using the Redis Pub/Sub correctly.
Stomp will connect to a single instance and will continue to be connected to that instance until it is disconnected.

So if there are 2 instances and 2 clients get connected to 2 different instances to sync messages across these instances you'd need Redis Pub/Sub.

@aminmc
Copy link
Author

aminmc commented Oct 23, 2018

Hi there. Thanks for the update. We have a Nginx proxy in front of the multiple WebSocket servers. So my assumption is that the proxy is disconnecting the client. In terms of Redis pub/sub is there docs you can point me to?

Thanks

@RawSanj
Copy link
Owner

RawSanj commented Dec 6, 2018

Hey @aminmc

Sorry for replying late.
For Nginx config you need to enable connection to switch to WebSockets.
I have that example as well, see the https://github.com/RawSanj/spring-redis-websocket/blob/master/src/main/docker/nginx.conf file.

Redis Pub/Sub doc can be found here - https://docs.spring.io/spring-data/redis/docs/2.1.3.RELEASE/reference/html/#pubsub

@RawSanj RawSanj added the question Further information is requested label Dec 6, 2018
@RawSanj RawSanj closed this as completed Dec 21, 2018
RawSanj added a commit that referenced this issue Dec 22, 2023
RawSanj added a commit that referenced this issue Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants