小编ram*_*tej的帖子

gRPC + Bazel + Envoy Json 代理 - 如何导入 google/api/annotations.proto

我有一个非常简单的 gRPC 服务,定义为:

syntax = "proto3";
package helloworld;
import "annotations.proto";

// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello(HelloRequest) returns (HelloReply) {
    option (google.api.http) = {
      post: "/api/v1/hello"
      body: "*"
    }
  }
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}
Run Code Online (Sandbox Code Playgroud)

有趣的是,我使用 Envoy gRPC <> JSON 转码过滤器在 HTTP2/Protobuf <> HTTP1/JSON 之间进行“翻译”。有关更多详细信息,请参阅https://www.envoyproxy.io/docs/envoy/latest/api-v1/http_filters/grpc_json_transcoder_filter …

java json protocol-buffers grpc bazel

3
推荐指数
1
解决办法
4252
查看次数

标签 统计

bazel ×1

grpc ×1

java ×1

json ×1

protocol-buffers ×1