Files
git.stella-ops.org/docs/features/checked/router/messaging-abstractions-library.md
2026-02-14 09:11:48 +02:00

30 lines
2.3 KiB
Markdown

# Messaging Abstractions Library (Queue, Cache, Event Stream, Rate Limiter)
## Module
Router
## Status
IMPLEMENTED
## Description
Transport-agnostic messaging abstractions library providing IMessageQueue, IDistributedCache, IEventStream, IRateLimiter, IIdempotencyStore, and IAtomicTokenStore contracts. Includes InMemory, Postgres, and Valkey transport implementations with plugin-based transport registration.
## Implementation Details
- **Modules**: `src/Router/__Libraries/StellaOps.Messaging/`, `src/Router/__Libraries/StellaOps.Messaging.Transport.InMemory/`, `src/Router/__Libraries/StellaOps.Messaging.Transport.Postgres/`, `src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/`
- **Key Classes**:
- `InMemoryTransportPlugin` (`src/Router/__Libraries/StellaOps.Messaging.Transport.InMemory/InMemoryTransportPlugin.cs`) - in-memory messaging transport
- `PostgresTransportPlugin` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Postgres/PostgresTransportPlugin.cs`) - PostgreSQL-based messaging transport
- `ValkeyTransportPlugin` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyTransportPlugin.cs`) - Valkey/Redis-based messaging transport
- `ValkeyMessageQueue` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyMessageQueue.cs`) - Valkey message queue implementation
- `ValkeyEventStream` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyEventStream.cs`) - Valkey event stream implementation
- **Interfaces**: `IMessageQueue`, `IMessageQueueFactory`, `IDistributedCache`, `IEventStream`, `IRateLimiter`, `IIdempotencyStore`, `IAtomicTokenStore`, `ISetStore`, `ISortedIndex`, `IMessagingTransportPlugin` (all in `src/Router/__Libraries/StellaOps.Messaging/Abstractions/`)
- **Source**: Discovered via source verification (part of Router ecosystem, Sprint 7000 series)
## E2E Test Plan
- [ ] Enqueue and dequeue a message via `IMessageQueue` with each transport (InMemory, Postgres, Valkey)
- [ ] Store and retrieve cache entries via `IDistributedCache` with each transport
- [ ] Publish and subscribe to events via `IEventStream` with each transport
- [ ] Verify `IRateLimiter` throttles requests above the configured limit
- [ ] Verify `IIdempotencyStore` prevents duplicate processing of the same message
- [ ] Switch transports via plugin registration and verify seamless operation