stomp-js / rx-stomp

STOMP adaptor for RxJS
Apache License 2.0
110 stars 21 forks source link

Rx-stomp doesn`t reconnect automatically #552

Closed nazarii-muliak closed 2 months ago

nazarii-muliak commented 2 months ago

When rx-stomp client reestablish connection, connectionState$ emits state 'OPEN'. Which means that connection is reestablished. But actually when you try to send a message via rx-stom client it says that connection is not established and will be queued. The only thing that can help to reestablish the connection is client manual hard-reset. You just need to deactivate and reactivate it manually. if (this.connectionState !== RxStompState.OPEN) { this.rxStompService.deactivate(); this.connectToChatRoom(); } Is it possible to somehow fix this reconnection issue without manual hard reset?

kum-deepak commented 2 months ago

Please enable debugging and share your entire console output.

nazarii-muliak commented 2 months ago

Ok it is fixed. For the automatic recconect I have updated myRxStompConfig file with this line: connectionTimeout: 1000 And now when connection is lost it will close and reopen the websocket connection automatically. The issue is fixed. Thank you