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
Redisson is not using name mapper on getKeys #4673
Comments
Fixed! Thanks for report |
Thanks a lot for the quick fix! |
for pattern methods you need to add it manually. Since Redisson doesn't parse patterns |
I think it is dangerous to not fix In my opinion everything on redisson that is related to KEYS should work with nameMapper. |
I agree, to implement handling of pattern = "*". As for other patterns it's impossible to predict that. Since some users can inject it into the name and not as prefix and suffix. |
Done |
Many thanks @mrniko for considering mapping the patterns! |
I deeply agree with that |
Hi there, thanks for the awesome library :)
I'm using redisson name mapper in order to have multiple environments (test/prod) working in the same redis cluster, where each environment has its own "namespace". EG.: test:key1, test:key2, prod:key1, prod:key2.
Redisson automatically adds my key prefix when using
getBucket
getAtomicLong
getMap
...But it does not automatically adds my key prefix if I use
getKeys
Expected behavior
I expected redisson to use the name mapper on getKeys:
redissonClient.getKeys().delete("K1", "K2");
Actual behavior
Redisson does not use the name mapper, I have to add it myself to delete multiple keys:
redissonClient.getKeys().delete("test:K1", "test:K2");
Steps to reproduce or test case
Configure redisson to use a name mapper with a prefix.
Create a bucket:
redissonClient.getBucket("K1").set("value");
Try to delete the bucket:
redissonClient.getKeys().delete("K1");
Check if bucket was deleted:
redissonClient.getBucket("K1").get()
Redis version
6.2
Redisson version
3.17.7
Redisson configuration
The text was updated successfully, but these errors were encountered: