我在从 GRPC 中的 .proto 文件生成存根时遇到了一些问题。这是 .proto 文件的样子
`syntax = "proto3";`
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}
该文件确实生成了协议缓冲区代码,但我没有从中得到任何服务存根。IE 我不能使用阻塞存根。
我尝试使用“java_multiple_files=true”修复,但这只是将生成的原始文件拆分为几个单独的原始文件。
我目前正在使用以下命令提示行来生成我的原型文件。
protoc --proto_path= src\proto\protoFile.proto --java_out=src\sourceThings
如果您有任何想法或需要更多信息,请告诉我。
谢谢!-DJ