Asynchronous protobuf based protocol. It behaves like gRPC, but the RPC calls are going through message broker queue.
This project includes qRPC generator and Go library.
qRPC provides custom protoc-gen-go extended with qRPC plugin.
To use this software, you must:
- Install the standard C++ implementation of protocol buffers from https://developers.google.com/protocol-buffers/
- Of course, install the Go compiler and tools from https://golang.org/ See https://golang.org/doc/install for details or, if you are using gccgo, follow the instructions at https://golang.org/doc/install/gccgo
- Grab the code from the repository and install the
proto
package. The simplest way is to run:The compiler plugin,go get -u github.com/cashwagon/qrpc/cmd/protoc-gen-go
protoc-gen-go
, will be installed in$GOPATH/bin
unless$GOBIN
is set. It must be in your$PATH
for the protocol compiler,protoc
, to find it.
Important: You need to override original protoc-gen-go.
How to use protoc-gen-go https://github.com/golang/protobuf/blob/master/README.md#using-protocol-buffers-with-go
To generate code compatible with qRPC pass the plugins
parameter to protoc-gen-go:
protoc --go_out=plugins=qrpc:. *.proto
The qRPC library uses abstract interfaces for drivers. So you can write your own driver to support custom message broker and pass it qRPC.
For now the only supported drivers for:
To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run:
go get -u github.com/cashwagon/qrpc/pkg/qrpc
See examples directory for examples.
- Docker
- Docker Compose
- git
- dip
Before runnings examples or tests you need to setup KAFKA_BROKERS
environment variable:
export KAFKA_BROKERS="kafka:9092"
dip provision
dip make lint
dip make test
dip make
dip make generate
dip psql
dip ls
eval "$(dip console)"
dip down
Host: http://localhost:9000
Manages local Kafka cluster. You need to setup cluster in kafka-manager for the first time:
Cluster -> Add Cluster
Cluster Name: local
Cluster Zookeeper Hosts: zookeeper:2181
Kafka Version: 2.2.0
Enable JMX Polling: Yes
Poll consumer information: Yes
Save
Host: http://localhost:9001
Allows to view and read topics from Kafka.
Project supports VSCode remote containers.
To start development with VSCode run dip provision
for the first time.
Then just run command Remote-Containers: Open Folder in Container...
in VSCode and select the project folder.