Class ThrottlingPipelineExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Excalibur.Dispatch.dll
Extension methods for adding throttling middleware to the dispatch pipeline.
public static class ThrottlingPipelineExtensions
- Inheritance
-
ThrottlingPipelineExtensions
- Inherited Members
Methods
UseThrottling(IDispatchBuilder)
Adds throttling middleware to the dispatch pipeline to protect the system from excessive message processing.
public static IDispatchBuilder UseThrottling(this IDispatchBuilder builder)
Parameters
builderIDispatchBuilderThe dispatch builder.
Returns
- IDispatchBuilder
The builder for fluent configuration.
Remarks
The throttling middleware enforces configurable rate limits to protect the system from excessive message processing and prevent resource exhaustion. It supports per-message-type, per-tenant, and global rate limiting with multiple algorithms (token bucket, sliding window, fixed window, concurrency).
For identity-based abuse prevention (per-user, per-API-key, per-IP), see
Excalibur.Security.RateLimitingMiddleware and its UseSecurityRateLimiting() extension.
Throttling options must be configured separately via
services.Configure<RateLimitingOptions>(). This method only adds the
middleware to the pipeline.
Recommended pipeline order:
builder.UseExceptionMapping()
.UseAuthentication()
.UseAuthorization()
.UseValidation()
.UseThrottling() // Before retry to prevent retry amplification
.UseRetry()
.UseCircuitBreaker();