[nanomsg] Re: Nanomsg and ZMQ

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Tue, 02 Apr 2013 12:57:53 +0200

On 02/04/13 12:24, Charles Remes wrote:
Nanomsg and ZMQ are not compatible. There is a ZMQ-compatibility API so that 
you can share *code*, but you can not hook up a nanomsg socket to a zmq socket.

Correct.

To give you some background:

One of the goals of nanomsg is to fix architectural problems in 0MQ. This mostly affects internals of the library (e.g. threading model) and is not visible from the outside.

However, one problem that happens to be visible is conflation of individual layers in the wire protocol. There are 3 layers involved: transport (such as TCP of PGM), scalability pattern layer (such as REQ/REP or PUB/SUB) and presentation layer (multi-part messages). Lately, addition of end-to-end encryption -- which can be thought as yet another layer -- is being discussed.

In ZeroMQ it's one monolithic protocol that handles all these layers. The result is that in the implementation is not modular. For example, there's no single piece of code to deal with multi-part messages. Instead, the code is scattered in TCP transport code, REQ/REP pattern code, PUB/SUB pattern code etc. Such code is a pain to implement and maintain and it is prone to subtle bugs.

Martin

Other related posts: