You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Spring Boot o.s.b.autoconfigure.cache.RedisCacheConfiguration translates the key-prefix to o.s.data.redis.cache.RedisCacheConfiguration#prefixKeysWith(String).
You can override the default by registering your very own o.s.data.redis.cache.RedisCacheConfiguration using computePrefixWith(CacheKeyPrefix) to generate the desired key.
Spring Boot is delegating to RedisCacheConfiguration#prefixKeysWith. That current arrangement causes issues to users so I am not keen to fix that in Spring Boot. Perhaps the implementation in Spring Data can be changed for all users? Or this settings can be deprecated with a migration path that Spring Boot could use?
That issue is addressed now by introducing a proper method prefixCacheNameWith(…) to configure a prefix for the entire entry instead of dropping the cache name. The Javadoc of the existing prefixKeysWith(…) now reflects what's happening.
Mykyta Bezverkhyi opened DATAREDIS-1041 and commented
Assuming I have
spring-data-redis
application with the following method:The entries are saved to Redis as following:
Now I can evict this cache using another method, for example:
And everything works as expected.
But setting property
gives me the following entry in Redis:
while
is expected.
Actual result: cacheNames parameter don't work when key-prefix is set.
Expected result: cacheNames parameter works as expected and all entries can be evicted
Affects: 2.2 GA (Moore)
Reference URL: spring-projects/spring-boot#16676
Issue Links:
("is duplicated by")
("supersedes")
Referenced from: pull request #507
1 votes, 5 watchers
The text was updated successfully, but these errors were encountered: