43

What are the differences between those amqp client libraries? Which one is the most recommended? What are the major differences?

Elad
  • 19,079
  • 18
  • 62
  • 71
Javier del Saz
  • 846
  • 1
  • 9
  • 16

7 Answers7

53

I would recommend amqp.node and bramqp over node-amqp. node-amqp has a lot of bugs and is poorly maintained, and it hides the "channel" concept which introduces a lot of problems for rabbitmq servers (because they are never closed).

Carl Hörberg
  • 5,973
  • 5
  • 41
  • 47
  • I have been working with bramqp and amqplib, and bramqp points to be by the moment a complete library solution. I like the 'direct' use of the amqp commands throug the "handle" object, so the point for you ;) Thanks mate! – Javier del Saz Nov 25 '13 at 17:54
  • 4
    +1 for pointing node-amqp hides "channel" concept which i was exploring in that from 2 days. – Ajay Sep 01 '14 at 08:47
  • I can second that node-amqp is kind of a poor module. Currently using amqplib and have been pleased so far. – afreeland Sep 12 '14 at 14:34
  • The first answered is dated from 2013. Carl, do you still think the same? Any update about this topic? In my case I am using node-amqp because it is pointed from the official web of Rabbitmq, but there are not too much updated. – jgato Jan 19 '15 at 06:45
  • Yes, node-amqp is still barley ever updated, but amqp.node is. https://github.com/LeanKit-Labs/wascally is also a good alternative, very easy to use. – Carl Hörberg Jan 20 '15 at 07:36
  • when shall i use rabbit.js ?? Rabbit.js is also same as amqp.node ? right – maddy Mar 18 '15 at 06:36
  • Wascally is now dead. I won't recommend a winning lib, but do your own research! – Askdesigners Apr 08 '17 at 09:43
49

I'm the guy that wrote the bramqp library. So I'm going to admit from the start I may be a bit biased. :P

In my opinion, as long as you know the spec, bramqp should work fine. Otherwise, use amqp.node


The following are the amqp libraries available for node.js.

amqplib / amqp.node - promise style, still updated, looks pretty stable and easy

bramqp - provides a full low level access to AMQP functions, not recommended for starting out

amqp-coffee - coffeescript implementation similar to amqp/node-amqp

amqp / node-amqp - popular, fixed API, not updated as often, a few odd bugs, stable but limited


The following libraries use one of the previous libraries, while providing an easier to use interface or adding features

rabbit.js uses amqplib/amqp.node

wascally uses amqplib/amqp.node

amq uses amqplib/amqp.node

amqpea uses bramqp

easy-amqp uses amqp/node-amqp

rabbus uses wascally


I am also going to add node-amqp10 separately, as it can connect to amqp 1.0 servers.

If there are any more that I should add, just let me know.

bakkerthehacker
  • 501
  • 3
  • 4
  • 1
    Totally agree, bramqp looks looks more robust and direct, but require a bit more of effort to start using and understand it. In other libraries each one has is own methods and technics for the same or simply lacks of certain funtions of amqp. Is my reason to have choosen bramqp this time – Javier del Saz Dec 04 '13 at 10:13
  • 1
    Useful comparison from creator of one of good libraries. There are multiple discussions on Node and RabbitMQ using node-amqp library. I was also installed that but subsequently found use of channels over single TCP connection for better resource management. But couldn't find its handling in node-amqp. As pointed by Carl, above, and you now planning to use amqp.node now because in am new but surely explore bramqp when gets better control on RabbitMQ. – Ajay Sep 01 '14 at 09:12
5

This question probably requires an updated answer in 2020.

You may still refer to bakkerthehacker's answer as to what the different libraries do.

In 2020:

  1. amqp doesn't seem to be supported anymore. It was last published 2 years ago.
  2. For AMQP 0-9-1 protocol, amqplib is the most widely used library.
  3. For AMQP 1.0 protocol, you could go with rhea.
SagarM
  • 311
  • 4
  • 14
2

I have been using node-amqp

npm install amqp

This is the one recommended by RabbitMQ which is why I've been using it. From what I've been doing, this module is more dry and readable compared to the other libraries I have seen.

sheldonk
  • 2,604
  • 3
  • 22
  • 32
2

I used both for a while. At the first glance, it might seem that node-amqp (amqp) is more adequate but it actually has so many bugs and no one is fixing them. For instances,

  1. RabbitMQ's MQTT and STOMP adapter should allow communication between clients using those 2 protocols with clients using AMQP, but node-amqp just fails to parse messages sent by MQTT or STOMP, while amqp.node (amqplib) can.
  2. node-amqp (amqp) has implemented auto-reconnecting and so doesn't throw exceptions on accidental disconnection. That means you will be forced to use the built-in reconnecting, you can't detect disconnection and handle it yourself. However, its reconnecting always double the number of connections. It will exhaust both client and server eventually. I'd rather code my own reconnecting function with amqp.node (amqplib).

I tested it with broker provided by www.robomq.io, it's a good one so the blame should be of the library. Implementing a perfect library in Node.js is tough though.

By the way, you can find a full set of example code using amqp.node (amqplib) in 5 scenarios at https://github.com/robomq/robomq.io/tree/master/sdk/AMQP/Node.js and the documentation at http://robomq.readthedocs.org/en/latest/one-one/#nodejs.

EaminZ
  • 51
  • 3
1

https://github.com/guidesmiths/rascal#rascal worth a mention too. It's built on top of amqplib, and has a set of useful features like auto reconnection logic, configuration based subscription / publication and good support for TDD.

cressie176
  • 959
  • 7
  • 8
0

Just started learning rabbitmq myself. I've found from other blogs that ampq.node is well accepted. Another one that I've found (not tested) is from wascally. https://github.com/LeanKit-Labs/wascally

Flexpadawan
  • 77
  • 1
  • 1
  • 8