protoc not generating service stub files

后端 未结 2 1372
[愿得一人]
[愿得一人] 2020-12-05 13:39

I have just started playing with google proto. When I try to compile proto file present in proto-java example, it does not generate any grpc file.

proto file, https:

2条回答
  •  感情败类
    2020-12-05 13:55

    You can add these option to your .proto (base on your language) to generate abstract services:

    option cc_generic_services = true;
    option java_generic_services = true;
    option py_generic_services = true;
    

    You can also add --plugin=EXECUTABLE option in your protoc cmd to use custom code generator plugin to generate code more specific to each system, rather than rely on the "abstract" services. Just like Eric's suggestion.

提交回复
热议问题