This sample was built to demonstrate a microservices architecture with the following components:
- Server: Connects to storage and exposes it as GRPC endpoints.
- Api: Exposes REST API to manage orchestrations.
- UI: Exposes UI to manage orchestrations.
- OrchestrationWorker: Implements BookParallel, BookSequential, EventDemo, and RewindDemo orchestrations for the given problem.
- FlightWorker: Implements BookFlight and CancelFlight activities.
- CarWorker: Implements BookCar and CancelCar activities.
- HotelWorker: Implements BookHotel and CancelHotel activities.
- BPMNWorker: An experimental BPMN runner built on top of Durable Tasks. There are also BookParallel and BookSequential BPMN workflows for the given problem.
- AppHost: Aspire.NET host project to orchestrate and run all applications.
-
Configure a EFCore storage at the server.
-
Run the AppHost project with
dotnet runor theAppHost samplelaunch config. -
Open Aspire Dashboard at https://localhost:17198/.
-
Open the DurableTask UI at https://localhost:5002/.
-
Create the following test orchestrations and watch them be executed:
Name Version InstanceId Input BookParallel v1 (Empty) { } BookSequential v1 (Empty) { } EventDemo v1 (Empty) { "correlationId": "demo-1" } RewindDemo v1 (Empty) { "RequestedCarType": "Sports" } BPMN (Empty) (Empty) { "name": "BookParallel" } BPMN (Empty) (Empty) { "name": "BookSequential" } BPMN (Empty) (Empty) { "name": "Bonus" } -
To test external events with
EventDemo, raise these events to the running instance:Event Name Event Data ApprovalRequested { "approved": true, "approvedBy": "alice", "reason": "looks good" } AddComment { "text": "approved from UI" } -
To test rewind with
RewindDemo:- Start
RewindDemowith versionv1and input{ "RequestedCarType": "Sports" }. - It fails intentionally on the first execution.
- Open the instance and click Rewind.
- The rewound execution succeeds.
- Start
This sample was built to demonstrate a single service architecture.
- SingleService: Implements the Client, Worker (just for an orchestration), API and UI.
-
Run the SingleService project with
dotnet runor theSingleService samplelaunch config. -
Create the following test orchestration and watch it being executed:
Name Version InstanceId Input SingleService (Empty) (Empty) { "InputText": "Chadwick" }