Skip to content

iamthusharp/daprsolution-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DaprSolution Example

This repository demonstrates a sample .NET solution using Dapr for service-to-service communication.
It contains two projects under one solution:

  1. OrderService – Sends requests to TransactionService.
  2. TransactionService – Receives requests and maintains a list of transaction codes.

This setup uses Dapr sidecars to handle service to service invocation without caring the tight dependencies between them.


Prerequisites


Download Dapr CLI

  1. Open powershell
powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"
  1. If installation fails try executing below command and install dapr cli again (skip if download is successful)
Powershell permission : Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Verify Dapr cli installation

dapr -h

Initialize the dapr cli

  1. Open command prompt as admin
dapr init

Verify dapr initialization is successful

dapr --version

Repository Setup

  1. Clone the repository:
git clone https://github.com/thushar-p/daprsolution-example.git

Run transaction service

  1. Open terminal in project folder
  2. Run this cmd
dapr run --app-port 8080 --app-id transaction --app-protocol http --dapr-http-port 8081 -- dotnet run
  1. Run swagger with localhost:8080/swagger

Run order service

  1. Open terminal in project folder
  2. Run this cmd
dapr run --app-port 7000 --app-id order --app-protocol http --dapr-http-port 7001 -- dotnet run
  1. Run swagger with localhost:7000/swagger

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors