Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

connect-amqp

blackwoodseven10MIT0.0.1

Wrapper around amqplib to easily call RPC trhough RabbitMQ

amqplib, rpc, nodejs

readme

amqp-connect

amqplib wrapper to easily connect to RPC services through RabbitMQ server.

Example

var connectAMQP = require('./connect-amqp');
exports.handler = function (event, context) {
  var doTheJob = function(connection) {
    var err, res;
    connection.send(event.queueName, event.data)
      .then(function(result) {
        res = result;
      })
      .catch(function(error) {
        err = error;
      })
      .ensure(function() {
        //Always close the connection!
        connection.close();
        context.done(err, res);
      });
  };

  connectAMQP(event.amqpURI)
    .then(doTheJob)
    .catch(function(e) {
      context.fail(e);
    });
};

Testing & developing

To run the test, first install all the dependencies with:

npm install

After, you can run

npm run test

To run all the tests. You can also run:

npm run watch

In order to run the test continuosly.

Travis build

Any commit to master will result on delpoying the new version to NPM Registry.