Skip to content

NATS based Event stream project using gRPC as service transport. This explores microservices project structure in Golang.

License

Notifications You must be signed in to change notification settings

ragul28/grpc-event-stream

Repository files navigation

gRPC Event stream

Event stream based Go microservice project using Nats JetStream, PostgresSQL & gRPC. Exhibit project to show case usage of cloud native ecosystem & tools.

Prerequisites

  • Golang 1.19+
  • Docker 20+ (compose extension)
  • Protoc compiler 3.8+

Running

  • Clone project & fetch go dependency

    go mod download
  • Compile event protocol buffer file & gen gRPC code

    make proto
  • Run the PSQL & Nats using docker

    docker compose pull
    docker compose up -d
  • Run DB migrations create tables.

    migrate -database ${POSTGRESQL_URL} -path migrations up
  • Run all the microservices in seprate shell

    go run cmd/order-svc/main.go
    go run cmd/payment-svc/main.go
  • Run sample client event flow

    go run cmd/client/main.go

About

NATS based Event stream project using gRPC as service transport. This explores microservices project structure in Golang.

Topics

Resources

License

Stars

Watchers

Forks

Packages