Logic questions for automatic re-subscription, automatic reconnection #515
-
Hello, I'm a student currently developing a chat app using Krossbow. Thank you for providing such a great library. From what I've read about reconnection issues so far, it seems that while there's an automatic reconnection feature using If a If so, even However, as far as I know, there isn't a function in the current library to check if the socket is currently connected or not. Additionally, does this mean that using the I'm developing my app thanks to your great library. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi! Thanks a lot for your question, and for your positive feedback too ❤️ You hit the nail right on the head. Technically, However, the STOMP server sees the new web socket connections that follow failures. So, from its point of view, it's a new client with no subscriptions. The server will therefore no longer send messages on the old subscriptions. Because of this, and because the Stomp client will not re-subscribe anything, the subscription flows will just hang (no new values and no errors) until the socket is actually closed. This is why some work is needed in the STOMP client itself to leverage the
For now, yes. I guess the explanation above is clear enough to understand why.
Yes to this too.
Indeed there isn't. But if the connection fails, you will get an exception in subscription flows, and you will also see it in the instrumentation (if you register one). So I guess you could trigger the reconnection at STOMP level from the instrumentation for now.
It's indeed not recommended if you're using the STOMP client on top of the web socket client. It's only useful for pure web socket for now. The topic was slightly touched here but I still haven't taken the time to clearly document this. Sorry about it. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick and friendly response. I also want to express my gratitude for providing the excellent Krossbow library. |
Beta Was this translation helpful? Give feedback.
Hi! Thanks a lot for your question, and for your positive feedback too ❤️
You hit the nail right on the head. Technically,
withAutoReconnect
makes the connection failures invisible to the web socket client caller. Instead, the caller only sees a continuous flow of web socket frames across reconnections. In the STOMP case, the caller of the web socket client is the STOMP layer, which doesn't see web socket failures, and thus doesn't not try to re-subscribe anything.However, the STOMP server sees the new web socket connections that follow failures. So, from its point of view, it's a new client with no subscriptions. The server will therefore no longer send messages on the old subscriptions.
…