NetMQ vs clrzmq
Asked Answered
O

2

6

Months ago I was selecting .NET library to use for implementing ZeroMQ communication, and I was pretty confused with the fact that there are few libraries suggested at zeromq.org.

Meanwhile I've learned few things, so I'll share here. Someone may find this helpful. So let me ask myself:

What is the difference between NetMQ and clrzmq?

(Although I'll answer this myself, if anyone else has some experience on the subject - alternative answer is welcome!)

Ober answered 31/7, 2016 at 10:9 Comment(0)
O
10

The key difference between the two is in the approach:

  • CLRZMQ is binding project which actually uses libzmq library in background (it's a .NET wrapper for libzmq library);
  • NetMQ is .NET-native port of ZeroMQ, meaning that it does not wrap existing libzmq but rewrites it in pure C#.

Which one to use? Well, there's no simple answer. Here are few important things to keep in mind while choosing:

  • When it comes to portability - NetMQ wins by far, especially due to the fact that there's .NET Core version of NetMQ. Deployment is also easier with NetMQ - there are no native libraries to worry about (x64 / x86, etc.).
  • On the other side the fact that NetMQ actually rewrites everything is bit scary for me - there's always risk that something is not precisely mirrored from the original code, and that it may cause incompatibility with other ZeroMQ nodes. There's also question how fast NetMQ will implement new features from the original library.
  • Performances. At the moment I don't know which library wins in performances, but this is definitely thing to consider while choosing. libzmq should be significantly faster than any managed code, but in communication between CLRZMQ and libzmq marshaling has to take place, so I really can't predict which library will win in speed.

UPDATE: Another important advantage of NetMQ is support - You'll get the answer in up to day or two, and sometimes within hours.

UPDATE 2: A problem with poller implementation in NetMQ (described here) turned out to be show-stopper problem for NetMQ in my case. Due to this problem I've migrated my projects to CLRZMQ (I may change my mind down the road...) Nevertheless, talking about poller, there's one problem in CLRZMQ documentation you should be aware of, and it's described here

Ober answered 31/7, 2016 at 10:9 Comment(2)
It's 2021 and I am here having the same question -- which one to choose. Did your opinion change? Appreciate new insights.Pissarro
@Pissarro I hope you went with NetMQ; as of 2022 clrzmq hasn't been updated in ~10 years, and doesn't run on .Net Core: github.com/zeromq/clrzmqBildungsroman
B
4

According to Doron Somech:

http://somdoron.com/2013/03/introducing-netmq/

As of 2014 C# binding (CLRZMQ) is no longer maintained and NetMQ is the default choice for ZeroMQ and .Net.

It seems that:

https://github.com/zeromq/clrzmq4

replaced the original CLRZMQ project.

I'm using NetMQ and looking forward to contribute to the project.

P.S. I build same Pub-Sub scenario for NetMQ and native ZeroMQ and didn't find any performance difference. Great work, Doron!

Bennion answered 12/8, 2016 at 22:41 Comment(1)
Have you tried majordomo pattern. it seems it get disconnected after some callsLeadwort

© 2022 - 2024 — McMap. All rights reserved.