Protos
In this document, you will learn the basic concept of protos in APISIX and why you may need them.
Explore additional resources at the end of the document for more information on related topics.
Overview
In APISIX, proto objects contain protocol buffer (protobuf) definitions which define the service interface and message types used in communication with upstream gRPC services.
The following diagram illustrates the concept of a proto object using an example of APISIX transcoding between HTTP and gRPC. In this example, the route /grpc-echo
is associated with the plugin grpc-transcode
and a proto object:
The gRPC server is registered with EchoService
defined in echo.proto
file, which echoes back string input from incoming requests.
To enable gRPC communication between APISIX and server, the protocol buffer definitions specified in the echo.proto
file are added to the proto object in APISIX. This ensures that APISIX and the gRPC server agree on the specifications of data exchange, allowing APISIX to effectively communicate with the gRPC server and relay the responses back to the client over HTTP.
To learn more about how to use grpc-transcode
for protocol transcoding, see Transcode HTTP to gRPC.
Additional Resource(s)
- Key Concepts - Routes
- How-To Guide - Transcode HTTP to gRPC
- Admin API - Protos