-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow adding specific keyspace/keyevent topic(s) with KeyspaceEventMessageListener
#2757
Comments
You should have a look at Issue #2670 as well. Also see PR #2671. There are good (examples) cases for your argument in this issue, and I generally agree with you. However, I will point out that the Spring Data Redis You can find one such implementation in Spring Data Redis with the Still, it is a simple matter to get what you want through extension. For example: public class MyApplicatonKeyspaceEventMessageListener extends KeyspaceEventMessageListener {
@Override
protected void doRegister(RedisMessageListenerContainer container) {
listenerContainer.addMessageListener(this, "__keyspace@*");
}
} Or even something more specific than Additionally, the Hope this helps! |
KeyspaceEventMessageListener
@jxblum FYI - to fix my problem, I just copy/pasted and modified the KeyspaceEventMessageListener code to allow for setting the topic.
|
Redis allows for more specific psubscribe filters allowing for subscription to specific keys, or specific events as documented in https://redis.io/docs/manual/keyspace-notifications/
However, the Spring KeyspaceEventMessageListener subscribes to "__keyevent@*", which doesn't include keyspace events, and provides all events.
This requires the programmer to filter every event for both the event type, and the key to see if the event is actionable.
Can a mechanism be added such that a more finite subscription topic be specified, e.g. an overload constructor allows a topic String, or other Setter that can be specified, and then call afterProperties() or init()?
The text was updated successfully, but these errors were encountered: