java ZeroMQ 用于移动协议缓冲区有效负载的替代方案是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10156388/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 23:51:10  来源:igfitidea点击:

What are the alternatives to ZeroMQ for moving protocol buffer payloads around?

javac++rpcprotocol-bufferszeromq

提问by mahonya

At the moment I have a solution that uses ZeroMQ to exchange protocol buffer payloads. The protocol buffer method of serialization is bound to stay as it is, but I can replace ZMQ with a more convenient option. The things I am not happy about in ZMQ are:

目前我有一个使用 ZeroMQ 交换协议缓冲区有效负载的解决方案。序列化的protocol buffer方法必然会保持原样,但我可以用更方便的选项替换ZMQ。我对 ZMQ 不满意的地方是:

It uses JNI on the Java side,and I've been bitten before by JNI, in complex, multi thread scenarios. I try to eliminate it whenever I can.

它在 Java 端使用 JNI,我以前在复杂的多线程场景中被 JNI 咬过。我尽量消除它。

I don't need queuing, I just need rpc.

我不需要排队,我只需要rpc。

My requirements (which are mostly covered by ZeroMQ) are:

我的要求(主要由 ZeroMQ 涵盖)是:

  • Support for 32/64 bit *nix, Windows, MacOS.

  • Support for Java, C++ and C# primarily, and Python, Ruby etc. would be nice.

  • Language support must be provided by native implementations in the language, not via wrapping native code.

  • High performance.

  • Non Viral license, no GPL, AGPL etc.

  • I've been thinking about using Thrift as the transport layer over TCP (I guess it supports that) with protocol buffers payloads, if its Java implementation for messaging is not using JNI.

  • 支持 32/64 位 *nix、Windows、MacOS。

  • 主要支持 Java、C++ 和 C#,以及 Python、Ruby 等会很好。

  • 语言支持必须由语言中的本机实现提供,而不是通过包装本机代码。

  • 高性能。

  • 非病毒许可,无 GPL、AGPL 等。

  • 我一直在考虑使用 Thrift 作为 TCP 上的传输层(我猜它支持)与协议缓冲区有效负载,如果它的 Java 消息传递实现不使用 JNI。

What options can you think of other than ZMQ for this setup?

对于此设置,除了 ZMQ 之外,您还能想到哪些选项?

采纳答案by Christopher Smith

Have you considered something like Stormor Spread?

你有没有考虑过StormSpread 之类的东西?

回答by Bertil Chapuis

You should probably have a look at Netty. It's a high performance Java NIO server framework with built-in support for Protocol Buffer which is released under the terms of the Apache License. The framework is well documentedand some examplesshow how to prototype protocols with Protocol Buffers.

您可能应该看看Netty。它是一个高性能的 Java NIO 服务器框架,内置对协议缓冲区的支持,协议缓冲区是根据 Apache 许可条款发布的。该框架有很好的文档记录,一些示例展示了如何使用 Protocol Buffers 对协议进行原型设计。

回答by Johann

The original question was asked about a year after JeroMQwas put onto github. It is the pure-java implementation of ZeroMQ. It has seen constant development throughout the intervening years and seems to be comparable in speedto the C-implementation.

最初的问题是在JeroMQ放到 github大约一年后提出的。它是 ZeroMQ 的纯 Java 实现。在此期间,它一直在不断发展,并且在速度上似乎C 实现相当