Protocol Buffers Java RPC Stack

☆樱花仙子☆ 提交于 2019-12-05 23:21:43

问题


According to this Wikipedia entry:

"Protocol Buffers is very similar to Facebook’s Thrift protocol, except it does not include a concrete RPC stack to use for defined services. Since Protocol Buffers was open sourced, a number of RPC stacks have emerged to fill this gap."

However, there are no examples of RPC stacks cited. Can anyone suggest a Java-based implementation of an RPC stack?


回答1:


If you want Java-based RPC stack, it's RMI. However, it doesn't work well cross platform.

I've been using ProtoBuf to do RPC. You can pretty much simulate an RPC stack by wrapping a protobuf message inside another protobuf, which defines the services or calls. Find my answer to this question for details,

Google Protocol Buffers and HTTP

Thrift looks like a very good alternative if you want support more platforms like PHP, Ruby, C# etc. However, it looks very complex to me compared to ProtoBuf.




回答2:


Google has open sourced their RPC framework gRPC, which uses Protocol Buffers to define the service and messages. gRPC is cross-platform with support for C, C++, C#, Java, Go, Node.js, Python, Ruby, Objective-C and PHP.

gRPC is based on the HTTP/2 standard that enables new capabilities such as bidirectional streaming, flow control, header compression and multiplexed connections.



来源:https://stackoverflow.com/questions/1437710/protocol-buffers-java-rpc-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!