This repo contains Dapr applications to demonstrate several Dapr building block APIs and the built-in resiliency capabilities.
Running the CodeTours in this repo is recommended since this gives more context about:
- The Dapr OSS project
- Service Invocation API
- State Management API
- Pub/Sub API
- Resiliency policies
- Prequisites
- Dapr Intro CodeTour
- Service Invocation CodeTour
- State Management CodeTour
- Service Invocation Demo CodeTour
- Pub/Sub CodeTour
- Pub/Sub Demo CodeTour
- Diagrid Conductor Free
- Resources
Ensure you have these installed on your machine:
- .NET 8
- Dapr CLI
- Docker Desktop
- VSCode - Although other IDEs can be used to view the code, some VSCode specific extensions are used (such as CodeTour) to help guide you through the codebase.
Clone the dapr-resiliency-and-durable-execution repo to your local machine.
Open the cloned repo in VSCode and accept the suggested VSCode extensions.
Using the CodeTour panel in the VSCode explorer, start the 1 - Dapr Intro CodeTour.
Using the CodeTour panel in the VSCode explorer, start the 2 - Service Invocation CodeTour.
Using the CodeTour panel in the VSCode explorer, start the 3 - State Management CodeTour.
Using the CodeTour panel in the VSCode explorer, start the 4 - Service Invocation Demo CodeTour. The BuildingBlockApisDemo consists of two applications, AppA and AppB, and a state store. Follow the instructions in the CodeTour to run the apps and use the Dapr Service Invocation API.
Service invocation
graph LR
A{{AppA}}
B{{AppB}}
State[(KV Store)]
A --HTTP--> B
B --> State
-
Navigate to the BuildingBlockApisDemo folder in the terminal:
cd BuildingBlockApisDemo
-
Run the BuildingBlockApisDemo apps using the Dapr CLI:
dapr run -f .
-
Open the local.http file in the VSCode editor and execute the HTTP requests to the BuildingBlockApisDemo apps.
Using the CodeTour panel in the VSCode explorer, start the 5 - Pub/Sub CodeTour.
Pub/sub
graph LR
A{{AppA}}
B{{AppB}}
MB[Message Broker]
State[(KV Store)]
A .-> MB .-> B
B --> State
Using the CodeTour panel in the VSCode explorer, start the 6 - Pub/Sub Demo CodeTour and follow the instructions in the CodeTour to run the apps and use the Dapr Pub/Sub API.
Diagrid Conductor Free is a free tool developers can use to visualize, troubleshoot, and optimize Dapr workloads on Kubernetes. It includes an Advisor that provides recommendations on how to improve the reliability of your Dapr applications.
Conductor Free also comes with two builders to generate Dapr component files and resiliency policies so you don't have to figure out the correct yaml schema yourself.