3.0 KiB
3.0 KiB
Saga Orchestration Roadmap
Completed (Phase 1)
Svrnty.CQRS.Sagas.Abstractions- Core interfaces and contractsSvrnty.CQRS.Sagas- Orchestration engine with fluent builder APISvrnty.CQRS.Sagas.RabbitMQ- RabbitMQ message transport
Phase 1d: Testing & Sample
Unit Tests
SagaBuilderstep configuration testsSagaOrchestratorexecution flow testsSagaOrchestratorcompensation flow testsInMemorySagaStateStorepersistence testsRabbitMqSagaMessageBusserialization tests
Integration Tests
- End-to-end saga execution with RabbitMQ
- Multi-step saga with compensation scenario
- Concurrent saga execution tests
- Connection recovery tests
Sample Implementation
OrderProcessingSagaexample in WarehouseManagement- ReserveInventory step
- ProcessPayment step
- CreateShipment step
- Full compensation flow
Phase 2: Persistence
Svrnty.CQRS.Sagas.EntityFramework
EfCoreSagaStateStoreimplementationSagaStateentity configuration- Migration support
- PostgreSQL/SQL Server compatibility
- Optimistic concurrency handling
Configuration
cqrs.AddSagas()
.UseEntityFramework<AppDbContext>();
Phase 3: Reliability
Saga Timeout Service
SagaTimeoutHostedService- background service for stalled sagas- Configurable timeout per saga type
- Automatic compensation trigger on timeout
- Dead letter handling for failed compensations
Retry Policies
- Exponential backoff support
- Circuit breaker integration
- Polly integration option
Idempotency
- Message deduplication
- Idempotent step execution
- Inbox/Outbox pattern support
Phase 4: Observability
OpenTelemetry Integration
- Distributed tracing for saga execution
- Span per saga step
- Correlation ID propagation
- Metrics (saga duration, success/failure rates)
Saga Dashboard (Optional)
- Web UI for saga monitoring
- Real-time saga status
- Manual compensation trigger
- Saga history and audit log
Phase 5: Flutter Integration
gRPC Streaming for Saga Status
ISagaStatusStreamservice- Real-time saga progress updates
- Step completion notifications
- Error/compensation notifications
Flutter Client
- Dart client for saga status streaming
- Saga progress widget components
Phase 6: Alternative Transports
Svrnty.CQRS.Sagas.AzureServiceBus
- Azure Service Bus message transport
- Topic/Subscription topology
- Dead letter queue handling
Svrnty.CQRS.Sagas.Kafka
- Kafka message transport
- Consumer group management
- Partition key strategies
Future Considerations
- Event Sourcing: Saga state as event stream
- Saga Versioning: Handle saga definition changes gracefully
- Saga Composition: Nested/child sagas
- Saga Scheduling: Delayed saga start
- Multi-tenancy: Tenant-aware saga execution