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