Search code examples
.net-coregrpcapi-gatewayocelotgrpc-dotnet

How to use gRPC service in .net api gateway?


I want to use the gRPC service with the api gateway. How can I use it for gRPC in .netcore? Can it be done using Ocelot?


Solution

  • You can not use Grpc with any API Gateway. Generally, API Gateway is designed for Rest. Rest and Grpc are very differeny. Rest works on Http1.1 and GRPC works on Http2. Also Rest and GRPC beheviors are very different.

    You can check this link to get detail info about this issue.

    So, Ocelot is not use for GRPC. In the Web, You can se un official implementation of Ocelot that support GRPC. But this is not acceptable. This implementaion only support a bit propert of grpc like Unary.

    This sturucture can be very usefull in this link