このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
Looking for the plugin's configuration parameters? You can find them in the gRPC-gateway configuration reference doc.
The gRPC-Gateway plugin allows you to send JSON requests to a gRPC service. A
specially configured .proto
file handles the conversion of the JSON request
into one that the gRPC service can handle. This allows you to expose RESTful-style
interfaces that talk to a gRPC service.
This plugin’s implementation is similar to gRPC-gateway.
Image credit: grpc-gateway
Why gRPC?
Unlike JSON, gRPC is a binary protocol, using Protobuf definitions to instruct how the data is marshalled and unmarshalled. Because binary data is used instead of text, it’s a more efficient way to transmit data over a network. However, this also makes gRPC harder to work with, because inspecting what went wrong is more challenging. Additionally, few clients natively handle gRPC.
To help alleviate the challenges of working with gRPC, Kong has two plugins:
- gRPC-Gateway
- gRPC-Web
For flexibility and compatibility with RESTful expectations, the gRPC-Gateway plugin offers more configurability, whereas the gRPC-Web plugin adheres more directly to the Protobuf specification.