# Valkey (Redis-Compatible) Messaging Transport for Gateway ## Module Router ## Status IMPLEMENTED ## Description Adds Valkey (Redis-compatible) as a messaging transport option for the Gateway/Router, including DI wiring, HELLO/heartbeat handling, atomic token store, cache factory, and messaging dispatch. Provides a high-performance alternative to the existing messaging infrastructure. ## Implementation Details - **Modules**: `src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/` - **Key Classes**: - `ValkeyTransportPlugin` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyTransportPlugin.cs`) - Valkey messaging transport plugin registration - `ValkeyMessageQueue` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyMessageQueue.cs`) - Valkey-backed message queue with lease support - `ValkeyMessageQueueFactory` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyMessageQueueFactory.cs`) - factory for creating Valkey message queues - `ValkeyEventStream` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyEventStream.cs`) - Valkey-backed event stream for pub/sub - `ValkeyAtomicTokenStore` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyAtomicTokenStore.cs`) - atomic token operations for idempotency - `ValkeyCacheStore` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyCacheStore.cs`) - Valkey-backed distributed cache - `ValkeyConnectionFactory` (`src/Router/__Libraries/StellaOps.Messaging.Transport.Valkey/ValkeyConnectionFactory.cs`) - manages Valkey connections - **Interfaces**: `IMessagingTransportPlugin`, `IMessageQueue`, `IEventStream`, `IAtomicTokenStore`, `IDistributedCache` - **Source**: SPRINT_8100_0011_0003_gateway_valkey_messaging_transport.md ## E2E Test Plan - [ ] Register `ValkeyTransportPlugin` and verify messaging operations work through Valkey - [ ] Enqueue and dequeue messages via `ValkeyMessageQueue` and verify ordering - [ ] Publish and subscribe to events via `ValkeyEventStream` and verify delivery - [ ] Verify `ValkeyAtomicTokenStore` provides atomic compare-and-set operations - [ ] Verify `ValkeyCacheStore` stores and retrieves cached entries with TTL - [ ] Verify connection pooling via `ValkeyConnectionFactory` under concurrent load