Blueprint ROA Golang gRPC Gateway With Emitter Kafka Streams
Description
Blueprint Emitter Service
Documentation
Emitter is one of the 3 parts of Goka’s Kafka streams that produce a message to
specified stream topic with given configurations. When Emitter producing
a message, there may be a Processor
waiting to process the message from stream topic
such as counter, filter or lookup etc.
Features
- Producer Message
- Support gRPC and RESTful
Dependencies
- Goka
- Protoc gen gRPC gateway
- Protoc gen OpenAPI V2
Prerequisites
- Docker
- Kafka
- Zookeeper
- Postgres
- Protoc
Run locally
- Install protoc gen gRPC gateway
go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
- Install protoc gen OpenAPI (Swagger)
go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
- Compile
.proto
file
make pbgen
- Start server
make start
Recommendation
Before push, should run linter always for code quality
- Install linter (golangci-lint)
go install github.com/golangci/golangci-lint/cmd/[email protected]
- Run linter
golangci-lint run
Connections
- GRPC: localhost:3000
- HTTP: localhost:3001
- Swagger: localhost:3001/swagger-ui