general-purpose binary protocols

随声附和 提交于 2020-02-01 04:13:25

问题


I'm trying to find a suitable protocol middleware for my next distributed application. I've found several specifications in the last few days and was wondering if I missed an important one? It should be a binary protocol, support RPCs and optionally have open-source implementations in different languages. Here's the list of protocols I found:

  • CORBA
  • ICE
  • AMQP
  • Thrift

And this is the list of dismissed protocols:

  • XML based protocols because they are text based (XML-RCP, SOAP, hand-rolled, etc.)
  • Protocol Buffers (Closed Source)
  • COM (Windows-only)

回答1:


The Protocol Buffers project definitely isn't closed source.

Which language/platform are you interested in?

  • For Java, C++ and Python there's the Google code.
  • For C# there are at least three projects (including mine or Marc's)
  • For other languages/platforms, see the relevant wiki page

Note that although there's stub RPC support in Protocol Buffers, Google hasn't released its actual RPC layer, so you'd have to provide your own. Given that basically you'd pass a request message and return a response message, it's not that hard to layer it over existing protocols (e.g. HTTP POST).




回答2:


I don't think Protocol Buffers are closed-source. The page implies differently, and there are source downloads.




回答3:


Quite possibly not the best candidate, but for completeness' sake I'd like to add that there's a binary encoding for XML.




回答4:


I would suggest that you reconsider Google Protocol Buffers. There are many open source implementations for all major platforms, including C++/Java/Python one published by Google itself.

As it was mention by Jon Skeet up above, PB spec does not define RPC model but it's extremely easy to define your own RPC using PB.

Alternatively, you could take a look at ASN.1. There is a ton of apps that use ASN.1.




回答5:


You could look at ASN.1.

It's used for encoding and transmitting binary data in many other protocols (e.g. SNMP, LDAP) although ASN.1 does not itself define a transport protocol.




回答6:


Joe Armstrong's UBF doesn't seem to have caught on, but it satisfies your requirements with a tasteful design.




回答7:


I would recommend trying out RabbitMQ AMQP, and using Protocol Buffers, XML, or some other data format such as JSON, to taste. In addition to being relatively simple and easy to get started with, this lets you mix and match RPC and asynchronous pubsub styles, and has a good spread across languages, protocols and platforms. But it may not be a good fit for your problem -- it all depends what you are trying to do! Cheers, alexis




回答8:


There is a patch from ZeroC to Ice to support Google Protocol Buffers natively.

http://www.zeroc.com/labs/protobuf/




回答9:


FlavorFlavor, used to define MPEG-4



来源:https://stackoverflow.com/questions/352433/general-purpose-binary-protocols

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