Spring Reactive Client Websocket - ReactorNettyWebSocketClient reconnect & close codes

137 views Asked by At

I am trying to use Spring Webflux Websockets - ReactorNettyWebSocketClient to be exact to connect my service to other service. I have done the implementation but I am seeing several things that I cant quite understand how to implement properly.

  1. Reconnection - in case a disconnection happens - or in case i stop the connection at a certain point and i want to resume it at a later time.
  2. How can i detect the CloseReason and CloseCodes during a disconnect event? I am seeing such behavior in Tomcat Websockets (in @OnClose)- and that works fine(https://docs.oracle.com/javaee/7/api/javax/websocket/CloseReason.CloseCodes.html), but i cant understand how it is possible to do that in Reactive way. The doOnTerminate or similar solutions do not provide such parameter.

Regarding the disconnection event - there are questions in SO but they are not answered or outdated - they mention the doOnTerminate operator but this does not have any reason and you can't detect if the connection was closed by you or the server.

Thanks a lot in advance

0

There are 0 answers