Stomp client does not subscribe to topics on re-connect.
Emitters are not cleaned when sockets are disconnected. Therefore subscribe message would not be sent after re-connect even if we add a new emmiter.
Set<FlowableEmitter<? super StompMessage>> emittersSet = mEmitters.get(destinationPath);
if (emittersSet == null) {
emittersSet = new HashSet<>();
mEmitters.put(destinationPath, emittersSet);
subscribePath(destinationPath, headerList).subscribe();
}
emittersSet.add(emitter);
The problem is that even if I unsubscribe on sockets disconnected it would not help as mentioned here.
I'm running into this issue as well, @NaikSoftware.
I've spent some time looking into this, but it looks like it's a dead end for me.
Can you try it with the downstream and let me know if you have the same problem? It does the Rx stuff differently, and it's useful for isolating bugs. Let me know your results.
Is there any update on this @NaikSoftware I am facing the same issue. It looks like some problem with disconnect call.
Thanks, @forresthopkinsa! The approach with subject seems much more reasonable. However, in your fork there is still a problem with topics. The list of topics is never cleaned and thus it's impossible to resubscribe on reconnect. I'll create an issue to discuss.
Thanks! I'll discuss it with you there.
Hello, I am facing similar kind of problem with the latest version of this library (Root cause may be same). Use case:
- When connection is lost, we get ERROR state in lifecycleEvent.
- But again when connection is restored, don't get a callback in any of the lifecycleEvent states. (Looking at the states , seems expected)
- But already subscribed events doesn't seem to be restored as nothing is received from server.
For interim solution, i have created a runnable which checks Stompclient state. If it is disconnected i make StompClient instance null and recreate a new one. Then again topic events are received. Its not a proper solution, but unless reconnection/topic sunbcribe is taken care from the lib, what are other options ?
Any progress on this?
@creativeprogramming OP and I made another thread about this, which I mentioned a few comments above. It looks like the problem is solved there.