Skip to content

jlorgal/grpc-golab-19

Repository files navigation

gRPC Golab 19

Demo for microservice talk in Golab Florence 2019. This demo is focused on gRPC microservices.

The application is built with 3 microservices:

Architecture

It exposes a REST API using grpc-gateway.

It also includes grpc middlewares to support metrics (via Prometheus) and tracing (via Zipkin).

Launching the docker-compose, it will launch Prometheus and Zipkin:

Run the demo

Execute the docker-compose:

docker-compose build && docker-compose up

Test

With the tool grpcurl, it is possible to send a request to the compose microservice exposed in port 4042.

grpcurl -plaintext -d '{"id": 1}' 127.0.0.1:4042 compose.proto.ComposeService/GetAuthor

The expected result is:

{
  "id": "1",
  "name": "Miguel de Cervantes",
  "books": [
    {
      "id": "1",
      "name": "Don Quixote"
    },
    {
      "id": "2",
      "name": "Rinconete and Cortadillo"
    },
    {
      "id": "3",
      "name": "Exemplary novels"
    }
  ]
}

In order to test the REST API:

curl -v http://localhost:8080/authors/2

About

Demo of gRPC microservices in Golab Florence 2019

Resources

License

Stars

Watchers

Forks

Packages

No packages published