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 key expiration and index of the database #44

Closed
shalltalk opened this issue Oct 5, 2020 · 2 comments
Closed

Redis key expiration and index of the database #44

shalltalk opened this issue Oct 5, 2020 · 2 comments

Comments

@shalltalk
Copy link

Thanks for the great lib.

May I know if it is possible to:

  1. set the expiration on the key?
  2. set the index of the database used by this connection factory? I'd like to use a different index from my other caches.
@shalltalk
Copy link
Author

shalltalk commented Oct 6, 2020

It can be done like this.

        RedisURI redisURI = RedisURI.Builder.redis(redisHost, redisPort).build();
        redisURI.setDatabase(redisDbRateLimit);
        RedisClient client = RedisClient.create(redisURI);
        client.setDefaultTimeout(Duration.ofMinutes(1));
        RedisRateLimiterFactory factory = new RedisRateLimiterFactory(client);

@shalltalk
Copy link
Author

See comment above.

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

1 participant