Making last-moment changes in the topic connection deactivation callback is problematic for at least two reasons:
Keeping the door open introduces complexity and a risk of race conditions for the internals of TopicConnection.
In case the change is doing a compare-and-swap operation and needs to retry, then the retry might happen too late.
Instead of relying on the connection deactivation callback to handle cleanup, the newly introduced EntryScope.CONNECTION setting should be used to configure the entry to be automatically removed when the connection is no longer active. This might require some changes to how data is structured in the topic, but it's the only approach that can work reliably in the long run.
Making last-moment changes in the topic connection deactivation callback is problematic for at least two reasons:
TopicConnection
.Instead of relying on the connection deactivation callback to handle cleanup, the newly introduced
EntryScope.CONNECTION
setting should be used to configure the entry to be automatically removed when the connection is no longer active. This might require some changes to how data is structured in the topic, but it's the only approach that can work reliably in the long run.