Giter Site home page Giter Site logo

vietnam-devs / northwind-on-dapr Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 107 KB

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

License: MIT License

Go 47.22% Dockerfile 8.01% C# 16.58% Java 28.19%
dapr dapr-component dotnet golang java grpc protobuf

northwind-on-dapr's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.