Skip to content

Latest commit

 

History

History
81 lines (65 loc) · 2.2 KB

README.md

File metadata and controls

81 lines (65 loc) · 2.2 KB

northwind-on-dapr

This is a demonstration for how to use Dapr with polyglot programming approach

Setup env

PRODUCT_HOST=localhost # if on Docker then it should be 0.0.0.0

POSTGRES_USER=northwind
POSTGRES_PASSWORD=<your password>
POSTGRES_DB=northwind_db

ProductGrpcUrl=http://localhost:50002

Local run - using Tye only

> tye run

Local run and debug manually

  • Run external services using Tye
> tye run --tags inf

Once external services such as postgres, rabbitMQ,... are started, continue to next commmands to launch microservices

  • Run the go-app (product-catalog) service
> cd ./product-catalog
> dapr run --app-id product-catalog --app-port 50002 --components-path ..\components\ --config ..\components\config.yaml -- go run .
  • Run the dotnet-core-app (sale-payment) service
> cd ./sale-payment
> dapr run --app-id sale-payment --app-port 5003 --dapr-grpc-port 50003 --components-path ..\components\ --config ..\components\config.yaml -- dotnet watch run
  • Run the java-app (shipping) service
> cd ./sale-payment
> dapr run --app-id shipping --app-port 5004 --components-path ..\components\ --config ..\components\config.yaml -- mvn spring-boot:run

Invoke API using Dapr CLI

sale-payment service

  • Invoke /ping
dapr invoke --app-id sale-payment -m /ping -v Get
  • Get all products of product-catalog service via sale-payment service using grpc proxy feature
dapr invoke --app-id sale-payment -m /api/products -v Get

shipping service

  • Invoke /
dapr invoke --app-id shipping -m / -v Get

Observability

Distributed tracing

It is enabled by default by Dapr; browse the url http://localhost:9411 to inspect any distributed trace from all microservices

Product Catalog Service

Sale Payment Service

gRPC

Tools:

  • BloomRPC: test gRPC
  • vscode.httpclient