问题描述
根据维基百科条目:
协议缓冲区与Facebook的Thrift协议非常相似,不同之处在于它不包含用于定义服务的具体RPC堆栈。由于协议缓冲区是开源的,因此出现了许多RPC堆栈以填补这一空白。
但是,没有引用RPC堆栈的示例。任何人都可以建议基于Java的RPC堆栈实现吗?
However, there are no examples of RPC stacks cited. Can anyone suggest a Java-based implementation of an RPC stack?
推荐答案
如果你想要基于Java的RPC堆栈,它是。但是,它不能很好地跨平台工作。
If you want Java-based RPC stack, it's RMI. However, it doesn't work well cross platform.
我一直在使用ProtoBuf来做RPC。您可以通过将protobuf消息包装在另一个定义服务或调用的protobuf中来模拟RPC堆栈。有关详细信息,请查找此问题的答案,
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,
如果您想要支持更多平台,如PHP,Ruby,C#等,Thrift看起来是一个非常好的选择。但是,它与ProtoBuf相比,我看起来非常复杂。
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.
这篇关于协议缓冲Java RPC堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!