Skip to content

Redis Rate limiting is tightly coupled with IConnectionMultiplexer #428

@Rashik004

Description

@Rashik004

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions