amqp-pubsub
1.0.0 • Public • Published amqp-pubsub
Minimalist abstraction layer for amqp publish/subscribe implementations
Installation
npm install amqp-pubsub
Usage
Publisher
var amqp = require('amqp');
var pubsub = require('amqp-pubsub');
var connection = amqp.createConnection({ host: "localhost" });
connection.on('ready', function() {
var pubsubClient = pubsub(connection, 'amqp-pubsub-example');
pubsubClient.publish({ test : 'hello world'});
});
Subscriber
var amqp = require('amqp');
var pubsub = require('../');
var connection = amqp.createConnection({ host: "localhost" });
connection.on('ready', function() {
var pubsubClient = pubsub(connection, 'amqp-pubsub-example');
pubsubClient.subscribe(function(message) {
console.log(message);
});
});
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads