Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC Service with Envoy Proxy

This project demonstrates a gRPC service exposed via Envoy Proxy, which translates RESTful HTTP/JSON requests into gRPC calls.

Directory Structure

  • 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.

How to Run

  1. Build the Docker images:

    make build
  2. Run the gRPC service, Envoy proxy, and client:

    make run
  3. Test the API:

    grpc request to the service[9090]:

    grpcurl -plaintext -proto item_service/item.proto -d '{"id": "123"}' localhost:9090 item.ItemService/GetItem

    grpc request to the proxy[8080]:

    grpcurl -plaintext -proto client_service/item.proto -d '{"id": "123"}' localhost:8080 item.ItemService/GetItem

    REST request to the proxy[8080]

    curl -v -X POST http://localhost:8080/v1/item/get \
      -H "Content-Type: application/json" \
      -d '{"id": "123"}'
  4. Clean up:

    make clean

About

Use envoy to transparently transcode REST requests to GRPC

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages