This is a demonstration for how to use Dapr with polyglot programming approach
- Add
.env
file on the root of this repository. That means on https://github.com/vietnam-devs/northwind-on-dapr
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
> tye run
- 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
/ping
dapr invoke --app-id sale-payment -m /ping -v Get
- Get all products of
product-catalog
service viasale-payment
service using grpc proxy feature
dapr invoke --app-id sale-payment -m /api/products -v Get
- Invoke
/
dapr invoke --app-id shipping -m / -v Get
It is enabled by default by Dapr
; browse the url http://localhost:9411
to inspect any distributed trace from all microservices
- REST URL: http://localhost:5002
- gRPC URL: tcp://localhost:50002
- Reference to how to run
- REST URL: http://localhost:5003
- Reference to how to generate protobuf
- BloomRPC: test gRPC
- vscode.httpclient