rsocket-java icon indicating copy to clipboard operation
rsocket-java copied to clipboard

Ongoing flux subscription is not getting cancelled even if the client is closed

Open SB-DevX opened this issue 1 year ago • 0 comments

When the client is closed, the rsocket server does not receive the cancellation event and ongoing flux subscription still continues which leads to data loss. How to cancel the ongoing subscription in server side when client is closed ?

Expected Behavior

If the client closes then server should also close all the active subscription for that client to prevent data loss.

Actual Behavior

If the client closes then server is not closing the active subscription. And if the flux is never ending, it leads to data loss.

Here is how I created the RSocketRequestor Bean in client side:

rSocketRequesterBuilder
                                 .setupRoute("requests.registration")
                                 .setupData(clientId)
                                 .rsocketStrategies(rSocketStrategies)
                                 .rsocketConnector(connector -> connector.reconnect(retryBackoffSpec)
                                                                        .resume(new Resume().retry(retryBackoffSpec)))
                                 .tcp("[localhost](http://localhost/)", 8085)

RSocket version(s) used: 1.1.3 Netty version: 4.1.93.Final JAVA version: 17

Hi, I have new to rsocket, not sure how to handle the above scenario. If there is any workaround to handle the above scenario, could you please help me ?

SB-DevX avatar Jul 31 '23 12:07 SB-DevX