tencent cloud

Feedback

Backend gRPC

Last updated: 2022-07-08 18:06:54

    Overview

    The backend gRPC plugin is used in the scenarios where the HTTP/HTTPS protocol is used for communication from the client to the API Gateway, and the gRPC/gRPCS protocol is used for communication from the API Gateway to the backend.
    Though the backend gRPC plugin, the API Gateway can obtain the .proto file (it is used to convert the HTTP/HTTPS protocol to the gRPC/gRPCS protocol), convert the request content according to the rule defined in the .proto file, and send the converted content to the backend.

    Request Process

    Directions

    Step 1. Create the plugin

    1. Log in to the API Gateway console.
    2. Click Plugin > System Plugin on the left sidebar.
    3. On the page that appears, click Create in the top-left corner. Select Backend gRPC for the plugin type, and create a backend gRPC plugin. The configuration item for this plugin is as follows:
    Parameter Required Description
    .proto description file Yes A .proto file that is used to convert the HTTP/HTTPS protocol to the gRPC/gRPCS protocol.
    The code in the file follows the ProtoBuf syntax and supports both proto2 and proto3 versions.

    Step 2. Bind an API and make the plugin effective

    1. Select the just created plugin in the list and click Bind API in the Operation column.
    2. In the Bind API pop-up window, select the service, environment, and the API to which the plugin needs to be bound.
    3. Click OK to bind the plugin to the API. At this time, the configuration of the plugin has taken effect for the API.

    Notes

    • the size of .proto description file cannot exceed 1MB.
    • the description file must strictly follow the ProtoBuf syntax.
    • when the HTTP/HTTPS protocol is configured for the API frontend and the gRPC/gRPCS protocol is configured for the backend, an error will occur for the request if the backend gRPC plugin is not bound to the API.
    • only when the client request method is POST, GET, PUT, PATCH or DELETE, "the API with the HTTP/HTTPS protocol configured for the frontend and the gRPC/gRPCS protocol configured for the backend" can be requested properly, otherwise an error will occur.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support