amqp-simple
Simplified amqp messgaging that supports retries and dead letter queues
Last updated 5 years ago by jasonxrowland .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install amqp-simple 
SYNC missed versions from official npm registry.

amqp-simple

Simplified amqp usage that supports retries, time outs, exceptions

var amqp = require('amqp-simple');
connection = new amqp.Connection({ 
  url: 'amqp://dockerhost',
  logger: function () {}  // ignore all logging
});
connection.open(function (err) {
  console.log('opened');
  connection.subscribe({
    routingKey: 'mykey',
    consumer: 'consumer',
    handler: function (msg, callback) {
      console.log('received message: ', msg);
      callback(); // acknowledge this message
      connection.close();
      console.log('disconnect?')
    }
  }, function () {
    connection.publish({
      routingKey: 'mykey',
      body: {
        hello: 'world'
      }
    }, function () {
      console.log('published message.')
    }); 
  });
});

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

3 Versions

  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (3)
Dev Dependencies (1)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |