This project demonstrates a Wolverine saga that orchestrates three distinct service calls (ServiceX, ServiceY, ServiceZ), each with unique messages, logging, metrics, and return values.
Client Request
↓
ThreeServiceSagaStarted
↓
ServiceX Call (unique metrics & logging)
↓
ServiceXCallCompleted
↓
ServiceY Call (receives ServiceX result, unique metrics & logging)
↓
ServiceYCallCompleted
↓
ServiceZ Call (receives ServiceY result, unique metrics & logging)
↓
ServiceZCallCompleted
↓
ThreeServiceSagaCompleted
- Three Distinct Endpoints: ServiceX, ServiceY, and ServiceZ
- Unique Messages: Each service has its own request/completion/failure events
- Unique Logging: Distinct log messages with emojis for easy tracking
- Unique Metrics: Each service tracks duration, success, and service-specific metadata
- Unique Return Values: Results from previous services are passed to subsequent ones
- Sequential Processing: ServiceY receives ServiceX's result, ServiceZ receives ServiceY's result
WolverineSagaApi/
├── Events/
│ └── SagaEvents.cs # Event definitions for all three services
├── Models/
│ └── SagaModels.cs # Request/response models
├── Sagas/
│ └── ThreeServiceSaga.cs # Main saga orchestration
├── Services/
│ ├── IServiceClients.cs # Service interfaces
│ └── ServiceClients.cs # Service implementations
├── Endpoints/
│ └── SagaEndpoints.cs # API endpoints
└── Program.cs # Application configuration
POST /api/saga/start
Content-Type: application/json
{
"requestId": "req-123",
"initialData": "test-data"
}GET /api/saga/status/{sagaId}GET /api/health# Restore dependencies
dotnet restore
# Build the project
dotnet build
# Run the application
dotnet run --project WolverineSagaApi
# Test the saga
curl -X POST http://localhost:5000/api/saga/start \
-H "Content-Type: application/json" \
-d '{"requestId": "req-123", "initialData": "test-data"}'Watch the console output to see:
- 🚀 Saga start
- 📞 Service calls (X, Y, Z)
- 📊 Unique metrics for each service
- ✅ Successful completions
- ❌ Failures (if any)
- 🎉 Final saga completion
- First service in the chain
- Processes initial data
- Duration: ~300ms
- Returns:
ServiceX-Processed-{data}
- Second service in the chain
- Receives ServiceX result
- Duration: ~450ms
- Returns:
ServiceY-Enhanced-{serviceXResult}
- Final service in the chain
- Receives ServiceY result
- Duration: ~600ms
- Returns:
ServiceZ-Final-{serviceYResult}
- Three Services: Instead of a generic multi-service flow, this explicitly orchestrates three distinct services
- Unique Events: Each service has its own request, completion, and failure events
- Unique Handlers: Separate handlers for ServiceX, ServiceY, and ServiceZ requests
- Unique Logging: Distinct log messages with service-specific context
- Unique Metrics: Each service tracks different metrics
- Data Flow: Results cascade from X → Y → Z
- .NET 10.0
- WolverineFx 5.13.0
- ASP.NET Core Minimal APIs
- In-memory message transport (for development)