java - How can I generate a GRPC Java Stubs from python project?
问题描述
I've just been following the GRPC python tutorial and I've managed to implement a python server and client (that work fine). But what I really want is a python server and a java client. However, when I run python -m grpc_tools.protoc --help
there is only a --python_out
option and not a --java_out
.
If I do something like this protoc -I=. --java_out=. protos/*.proto
it won't generate the GRPC stubs that I need for the client.
Do I need to manually copy + paste the .proto
file into a java project and use the gradle plugin to generate the stubs? That doesn't seem like the right way to do it though.
解决方案
对于java客户端,需要使用java protobuf插件生成的stub,需要单独安装。你能看看这个链接吗: https ://github.com/grpc/grpc-java/tree/master/compiler
推荐阅读
- google-play - 一些每日应用统计信息目前出现延迟。我们希望很快解决这个问题
- sql - Toad Notation - (Ix#) 是什么意思?
- excel - 如何将数组排序到范围
- amazon-web-services - 导入的 SSL 证书未显示在 CloudFront 中
- reactjs - 未捕获的错误:找不到模块“history/lib/DOMStateStorage”
- vuejs2 - Vue js - 如何使用查询字符串路由请求
- java - 需要使用矩阵平滑图像 - 计算细胞总和并计算平均值
- python - TKinter 属性 Simpledialog 错误
- reactjs - 通常向组件添加自定义属性
- junit4 - PowerMock 没有存根正确的方法