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

Document Websocket auto reconnect feature #213

Open
serhiynovos opened this issue May 29, 2022 · 1 comment
Open

Document Websocket auto reconnect feature #213

serhiynovos opened this issue May 29, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@serhiynovos
Copy link

Do you have any examples how to implement auto reconnect feature ?

@serhiynovos serhiynovos changed the title Websocket reconnect Websocket auto reconnect May 29, 2022
@joffrey-bion
Copy link
Owner

joffrey-bion commented May 29, 2022

If you're using the web socket artifacts directly and not STOMP, you can use yourWebSocketClient.withAutoReconnect() to get a client that will automatically retry to connect when the web socket errors:
https://github.com/joffrey-bion/krossbow/blob/main/krossbow-websocket-core/src/commonMain/kotlin/org/hildan/krossbow/websocket/reconnection/ReconnectingWebSocketClient.kt#L23

If you're using STOMP, the feature is not implemented yet as it requires a few changes in the implementation of subscriptions so we can resubscribe all existing subscriptions automatically when the web socket reconnects. It is tracked in #102.

@joffrey-bion joffrey-bion added the question Further information is requested label Jun 2, 2022
@joffrey-bion joffrey-bion changed the title Websocket auto reconnect Document Websocket auto reconnect feature Jun 10, 2022
@joffrey-bion joffrey-bion added documentation Improvements or additions to documentation and removed question Further information is requested labels Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants