This project demonstrates a gRPC service exposed via Envoy Proxy, which translates RESTful HTTP/JSON requests into gRPC calls.
item_service/: Contains the gRPC service implementation.client_service/: Contains the gRPC client implementation. You can also run below commands from (3)docker-compose.yml: Orchestrates the gRPC service, Envoy proxy, and client.
-
Build the Docker images:
make build
-
Run the gRPC service, Envoy proxy, and client:
make run
-
Test the API:
grpc request to the service[9090]:
grpcurl -plaintext -proto item_service/item.proto -d '{"id": "123"}' localhost:9090 item.ItemService/GetItemgrpc request to the proxy[8080]:
grpcurl -plaintext -proto client_service/item.proto -d '{"id": "123"}' localhost:8080 item.ItemService/GetItemREST request to the proxy[8080]
curl -v -X POST http://localhost:8080/v1/item/get \ -H "Content-Type: application/json" \ -d '{"id": "123"}'
-
Clean up:
make clean