mirror of https://github.com/dapr/quickstarts.git
* Changed loop from while to for Signed-off-by: Amulya Varote <amulyavarote@QTM-SWATHIKIL-1.redmond.corp.microsoft.com> * Removed random imports Signed-off-by: Amulya Varote <amulyavarote@QTM-SWATHIKIL-1.redmond.corp.microsoft.com> Co-authored-by: Amulya Varote <amulyavarote@QTM-SWATHIKIL-1.redmond.corp.microsoft.com> |
||
|---|---|---|
| .. | ||
| checkout | ||
| order-processor | ||
| README.md | ||
README.md
Dapr pub/sub
In this quickstart, you'll create a publisher microservice and a subscriber microservice to demonstrate how Dapr enables a publish-subcribe pattern. The publisher will generate messages of a specific topic, while subscribers will listen for messages of specific topics. See Why Pub-Sub to understand when this pattern might be a good choice for your software architecture.
Visit this link for more information about Dapr and Pub-Sub.
Note: This example leverages the Dapr client SDK. If you are looking for the example using only HTTP click here.
This quickstart includes one publisher:
- Dotnet client message generator
checkout
And one subscriber:
- Dotnet subscriber
order-processor
Run Dotnet message publisher with Dapr
- Open a new terminal window and navigate to
checkoutdirectory:
cd checkout
- Install dependencies:
dotnet restore
dotnet build
- Run the Dotnet publisher app with Dapr:
dapr run --app-id checkout --components-path ../../../components/ -- dotnet run
Run Dotnet message subscriber with Dapr
- Open a new terminal window and navigate to
checkoutdirectory:
cd order-processor
- Install dependencies:
dotnet restore
dotnet build
- Run the Dotnet subscriber app with Dapr:
dapr run --app-id order-processor --components-path ../../../components/ --app-port 7001 -- dotnet run