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

redis cluster,config set notify-keyspace-events Ex, but can't Trigger redis expired event #5310

Closed
MrH2H opened this issue Sep 3, 2018 · 8 comments

Comments

@MrH2H
Copy link

MrH2H commented Sep 3, 2018

Hi,I use redis cluster,config set notify-keyspace-events Ex, but it couldn't Trigger redis expired event,

like this:
container.addMessageListener( messageListener(), new ChannelTopic( "keyevent@0:expired" );

but standalone it's success;

What should I do?

Thanks;

@MrH2H
Copy link
Author

MrH2H commented Sep 8, 2018

@hongliuliao
hi
They look the same;

@itamarhaber
Copy link
Member

itamarhaber commented Sep 8, 2018 via email

@mgravell
Copy link

mgravell commented Sep 8, 2018

Note: keyspace notifications are node-specific, unlike regular pub/sub which is broadcast from all nodes. So: you (or the library you are using) would need to attach to all nodes to reliably get keyspace notifications from cluster.

@itamarhaber
Copy link
Member

Thanks @mgravell, GTK (or be reminded ;)).

This issue can be closed, as it is a question that was answered.

@dealslama
Copy link

@mgravell Hi Marc, Can you help me with adding nodes for subscriptions? I mean do I need to provide HOST IP or NodeID of each node?
@itamarhaber

@itamarhaber
Copy link
Member

@dealslama as keyspace notifications are not broadcasted in the cluster you'll have to:

  1. Open a connection to each of the cluster's nodes
  2. In each connection, subscribe to keyspace notifications from that node

@huangzhuxing
Copy link

Need to modify the configuration on each node

@itamarhaber
Copy link
Member

This has been also added to the documentation via redis/redis-doc#1367

Closing - feel free to reopen or create a new issue if needed.

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

5 participants