Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saintedlama/amqp-pubsub
Minimalist abstraction layer for amqp publish/subscribe implementations
https://github.com/saintedlama/amqp-pubsub
Last synced: about 15 hours ago
JSON representation
Minimalist abstraction layer for amqp publish/subscribe implementations
- Host: GitHub
- URL: https://github.com/saintedlama/amqp-pubsub
- Owner: saintedlama
- License: isc
- Created: 2015-02-04T07:49:16.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-15T07:47:46.000Z (over 8 years ago)
- Last Synced: 2024-10-12T12:25:44.607Z (about 1 month ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# amqp-pubsub
Minimalist abstraction layer for amqp publish/subscribe implementations## Installation
```
npm install amqp-pubsub
```## Usage
Publisher
```javascript
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
```javascript
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);
});
});```