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 Rate limiting is tightly coupled with IConnectionMultiplexer #428

Open
Rashik004 opened this issue Mar 29, 2023 · 1 comment
Open

Comments

@Rashik004
Copy link
Contributor

The RedisProcessingStrategy.cs file is tightly couped with IConnectionMultiplexer. The constructor has a code like below:

_connectionMultiplexer = connectionMultiplexer ?? throw new ArgumentException("IConnectionMultiplexer was null. Ensure StackExchange.Redis was successfully registered");

That means for rate limiting with Redis, we need to Use the default connection multiplexer that is registered with IConnectionMultiplexer. But if the user wants to use a different connection multiplexer for rate limiting, they have no way of doing it other than implementing a new implementation of ProcessingStrategy and registering it manually.

There should an easier option to supply the connection multiplexer instance while registering the Redis Rate limit while calling the function AddRedisRateLimiting. The signature of the function can something like below:

public static IServiceCollection AddRedisRateLimiting(this IServiceCollection services, IConnectionMultiplexer connectionMultiplexer = null)

@Rashik004
Copy link
Contributor Author

The PR #431 Resolves this issue.

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