node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

amqper

amqper

NPM Version Build Status Coverage Quality Dependencies

A simple and elegant AMQP client for node based on amqplib.

Install

$ npm install --save amqper

Usage

round-robin

Run multiple consumer.js for round-robin shared.

consumer.js

var amqper = require('amqper');
 
var client = amqper.connect('amqp://guest:guest@localhost:5672');
 
client.route('test.a', {}, function (message) {
  console.log(message.payload);
});
 
 

producer.js

var amqper = require('amqper');
 
var client = amqper.connect('amqp://guest:guest@localhost:5672');
 
for (var i = 0; i < 10; i++) {
  client.publish('amq.topic', 'test.a', i);
}
 

License

MIT © Tao Yuan