This is a sample that shows a bit about grpc and docker swarm. The demo contains two kind of services. A GRPC server that works as a counter and a HTTP server which use the counter service to keep track of the number of times the endpoint /count has been hit
This example is written in Go
$ brew install go
Go package manager
$ brew install glide
$ brew install protobuf
$ go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
$ brew cask install docker
You have to configure docker in swarm mode
$ docker swarm init
To start the demo run:
$ make
This will run one replica of the server and three replicas of the client. To see some action run this:
$ while true; do curl "http://localhost:8080/count"; sleep 0.5; done
and in a separate terminal run:
$ make log
To stop the services run:
$ make stop