[nanomsg] NanoMsg ABI compatible with ZeroMQ feature

  • From: "John Carneiro" <johncarneiro@xxxxxxxxxxx>
  • To: <nanomsg@xxxxxxxxxxxxx>
  • Date: Tue, 20 May 2014 12:44:50 -0400

I saw this post below online here describing a way to create a nanomsg library is fully ABI-compatible with ZeroMQ:

http://250bpm.com/blog:21

Is this possible with version 0.3 beta, I didn't see a nn_zmq method available or a ZMQ_COMPAT defined ?

If not, when would this be available, or has this been deprecated and not planned any longer ?

Thanks

-

"Reusing ZeroMQ bindings

The easiest way to access nanomsg from various languages would be to simply reuse ZeroMQ language bindings (there are approximately 40 of them at the moment). To help with that, nanomsg provides a ZeroMQ compatibility mode which produces a fake ZeroMQ library that simply forwards the function invocations to nanomsg.

$ mkdir build
$ cd build
$ cmake -DZMQ_COMPAT=ON ..
$ make
$ sudo make install

Although the library is fully ABI-compatible with ZeroMQ, there are differences in functionality between two libraries — nanomsg provides more messaging patterns etc.

Of course, original ZeroMQ bindings are not aware of the new functionality and lack definitions for the new constants. Thus, the user has to enter the constants by their numeric values. For details have a look at nn_zmq(7) manual page. However, if the language binding uses enums instead of ints for socket types, socket options etc., there's little the user can do to access the new nanomsg functionality. The binding won't just allow unknown constants to be passed to the functions."

Other related posts: