Files
git.stella-ops.org/docs/features/unchecked/router/router-backpressure.md

25 lines
1.3 KiB
Markdown

# Router Backpressure (HTTP 429/503 + Retry-After)
## Module
Router
## Status
IMPLEMENTED
## Description
Rate limiting and backpressure testing with dedicated chaos test suite for the router, including Testcontainers-based fixture for burst testing.
## Implementation Details
- **Modules**: `src/Router/__Libraries/StellaOps.Router.Gateway/RateLimit/`, `src/Router/__Libraries/StellaOps.Router.Transport.InMemory/`
- **Key Classes**:
- `ValkeyRateLimitStore` (`src/Router/__Libraries/StellaOps.Router.Gateway/RateLimit/ValkeyRateLimitStore.cs`) - Valkey-backed rate limit storage for per-instance throttling
- `InMemoryRateLimiter` (`src/Router/__Libraries/StellaOps.Messaging.Transport.InMemory/InMemoryRateLimiter.cs`) - in-memory rate limiter for testing
- **Source**: Feature matrix scan
## E2E Test Plan
- [ ] Send requests exceeding the rate limit and verify HTTP 429 responses with Retry-After header
- [ ] Verify HTTP 503 response when all instances are overloaded
- [ ] Verify backpressure propagation: confirm the gateway signals backpressure to callers when queues are full
- [ ] Verify rate limit recovery: after throttling, confirm requests resume when the limit window expires
- [ ] Verify per-instance rate limiting: confirm each microservice instance has its own rate limit counter