本文介绍了用于gRPC / protobuf的Java IDL(Protocl缓冲区)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 是否可以使用Java定义协议缓冲区?Is it possible to define Protocol Buffers using Java?这不是service Greeter { rpc SayHello (HelloRequest) returns (HelloReply) {}}我想要public interface Greeter { @Grpc HelloReply sayHello (HelloRequest req);}@GrpcMessage()public class HelloReply{ @GrpcField(1) string name;}这是我的POJO上的Hibernate / JPA注释,而不是生成的堆代码。That is annotation like Hibernate/JPA over my POJO, instead of heaps of generated code.我只能找到Protocol Buffers Dynamic Sc​​hema https://github.com/os72/protobuf-dynamicI only could find Protocol Buffers Dynamic Schema https://github.com/os72/protobuf-dynamic推荐答案看看protostuff: https://github.com/protostuff/protostuff 它支持你想要的protobuf(虽然不适合grpc,也许它可以增强)Have a look at protostuff: https://github.com/protostuff/protostuffIt supports what you want for protobuf (although not for grpc, perhaps it can be enhanced) 这篇关于用于gRPC / protobuf的Java IDL(Protocl缓冲区)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 15:14