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

keyspaceEvents cannot be configured [DATAREDIS-1075] #1612

Open
spring-projects-issues opened this issue Dec 4, 2019 · 2 comments
Open

keyspaceEvents cannot be configured [DATAREDIS-1075] #1612

spring-projects-issues opened this issue Dec 4, 2019 · 2 comments
Assignees
Labels
in: cache RedisCache and CacheManager in: jedis Jedis driver in: repository Repositories abstraction type: bug A general bug

Comments

@spring-projects-issues
Copy link

ismael COULIBALY opened DATAREDIS-1075 and commented

Hey guys,
Me and my team are facing a probleme due to the usage of Spring Data Redis 2.2.2 in a Spring Boot App.
We are working on a App based on a microservice architecture. Three of our microservices put data in the same instance of Redis but inside different logical databases.
Some of data we put into Redis are tagged with the annotation @TimeToLive (TTL).
We also enabled the keyspaceEvents on start up [@EnableRedisRepositories(enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP)].

The probleme we face is that keyspaceEvents are seen (received) by all logical databases. That make our pool of connection explode.

It seems like the management of keyspaceEvents is done right here : https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/listener/KeyExpirationEventMessageListener.java
In the code, we can see this : "keyevent@*:expired".
The wildcard means that the keyspaceEvents are seen by every logical database.

So, all of our microservices pollute each other because each of them see the keyspaceEvents of the other.

Can you make keyspaceEvents management configurable (TTL in particular) so that a logical database only receive events that happen in his scope ?

Regards


Referenced from: pull request #503

1 votes, 2 watchers

@spring-projects-issues spring-projects-issues added in: cache RedisCache and CacheManager type: bug A general bug in: jedis Jedis driver in: repository Repositories abstraction labels Dec 30, 2020
@serac
Copy link

serac commented Sep 8, 2022

We have hit upon the same limitation as described here. I see that a PR (#503) has been submitted with additional configuration knobs, but no further work after a suggested improvement from one of the maintainers. Has any further work been done on a solution?

@ameena007
Copy link

Hello team, this is a critical requirement i think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: cache RedisCache and CacheManager in: jedis Jedis driver in: repository Repositories abstraction type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants