A Node.js native wrapper around Apache Qpid, specifically the AMQP 1.0 Proton C Messenger API
C++ C JavaScript Python
Clone or download
Pull request Compare This branch is 21 commits ahead of noodlefrenzy:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
src
test
.gitignore
README.md
binding.gyp
index.js
package.json

README.md

node-qpid

A Node.js native wrapper around Apache Qpid, specifically the AMQP 1.0 Proton C API.

Usage

You can use it to exchange messages with AMQP 1.0 brokers:

// Sending
var Messenger = require('qpid').proton.Messenger;
var m = new Messenger();

m.send({address: address, body: message}, function(err) {
  if (err) {
    console.log("Error sending message: " + err.message);
  }
});
// Receiving
var Messenger = require('qpid').proton.Messenger;
var m = new Messenger();

m.on('subscribed', function(url) {
  console.log("Subscribed to " + url);
});

m.on('message', function(message) {
  console.log(message.body);
});

m.subscribe(address).receive();

The module has been preliminarily tested against:

Installation

This module expects that you have the following installed on your system:

Building qpid-proton is fairly involved, so to ease that burden, grabbing and installing the binaries from debian sid is a faster (and probably less error prone) approach. There is a PPA for qpid/released, however the libraries there are not compiled against OpenSSL and SSL support is needed for connecting to Service Bus using AMQP.

For Ubuntu 14.04, you can set up all the necessary requirements as follows:

# wget http://ftp.us.debian.org/debian/pool/main/q/qpid-proton/libqpid-proton2-dev_0.7-1_amd64.deb
# wget http://ftp.us.debian.org/debian/pool/main/q/qpid-proton/libqpid-proton2_0.7-1_amd64.deb
# sudo dpkg -i libqpid-proton2-dev_0.7-1_amd64.deb libqpid-proton2_0.7-1_amd64.deb
# sudo apt-get install build-essential git
# sudo apt-get install nodejs-legacy nodejs-dev nodejs npm

Until this module is committed back to main branch and published as an npm module, to build and install it, do the following:

# mkdir tmp
# cd tmp
# git clone https://github.com/jmspring/node-qpid.git
# cd node-qpid
# sudo npm install -g .

At this point, you are ready to use the module.

Issues

Grabbing binaries directly from debian sid for Ubuntu is a little silly, but for now it works.

It's still rough around the edges and not ready for prime time, but pull requests are welcomed!

Acknowledgements

node_sqlite3 has been an invaluable resource while writing this native module!