Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect pub sub subscription status/connection on the cluster client? #2725

Open
Nic0S opened this issue Mar 27, 2024 · 0 comments
Open

Detect pub sub subscription status/connection on the cluster client? #2725

Nic0S opened this issue Mar 27, 2024 · 0 comments

Comments

@Nic0S
Copy link

Nic0S commented Mar 27, 2024

Motivation

My goal is to detect the state of a long running pubsub subscription in cluster mode. For example, if the client is disconnected from the cluster for some amount of time (let's say network issue, or restart of a Redis node), it would be useful to receive some event from the client, and to receive another event once the subscription is reestablished.

According to #1855,
the cluster client does not produce events on reconnection. How can the application monitor the current status of the subscription?

To explain more about my use case, we are using pubsub for cache invalidation across machines. If the subscription connection to Redis is lost for any reason, we need to invalidate the whole cache and stop inserting new values until we get the connection back.

Is this something that can be accomplished currently?

Another related question; what happens if a value is published while the client is reconnecting to Redis? Will the value be published upon reconnection, assuming the client eventually does reconnect?

Basic Code Example

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant