ASMGrpcJsonTranscoder is used for transcoding between HTTP/JSON and gRPC/Protobuf. This topic describes the fields of ASMGrpcJsonTranscoder.
Field description
Field | Type | Required | Description |
workloadSelector | map<string, string> | Yes | One or more labels that specify a set of pods on which the configurations take effect. The scope of label search is restricted to the namespace in which the resource resides. For more information, see Workload Selector. |
isGateway | bool | No | Specifies whether to apply the configurations to a gateway. The value true indicates that the configurations apply to the gateway. Default value: false. |
portNumber | int | Yes | The corresponding service port. If the configurations apply to a gateway, this field specifies the service port (such as 8080) that performs transcoding on the gateway. |
services | string[] | Yes | The services that the configurations declared in the Proto file in the |
protoDescriptorBin | string | Yes | The Base64-encoded content of the Proto Descriptor file. Note that the value of this field must be Base64-encoded. |
transcodeFirst | bool | No | Default value: false. The value true indicates that an HTTP requests is transcoded first before other processing. This may affect the request-based traffic control features. For example, if the request sent to custom external authorization services is transcoded first, the service receives a gRPC request. Otherwise, it will receive an HTTP request. |
convertGrpcStatus | bool | No | The default value is false. Specifies whether to convert grpc-status to JSON. After you set this parameter to true, the For example, the upstream server responses with the following header: The grpc-status-details-bin header contains a Base64-encoded protobuf message |
ignoredQueryParameters | []string | No | The query parameters that are ignored when transcoding method is mapped. By default, if any unknown or invalid query parameters exist, the transcoder will not transcode the request. The ignored HTTP request query parameters declared in ignoredQueryParameters will be ignored when they appear in the request, and the request can be transcoded. |
ignoreUnknownQueryParameters | bool | No | The query parameters to specify whether to ignore HTTP request that cannot be mapped to corresponding protobuf fields. Configure this parameter if unknown query parameters exist. Otherwise, configure ignoredQueryParameters. Important If both |
References
Use ASMGrpcJsonTranscoder to allow HTTP/JSON requests to access gRPC services in an ASM instance