gleipnir-publish
v2.0.0
Published
Gleipnir module that manages publishing of messages
Downloads
5
Maintainers
Readme
gleipnir-publish
Gleipnir module that manages publishing of messages. Current features:
- Queues messages while gleipnir connects and asserts exchanges/queues/bindings, then flushes local queue
- Simplifies sending messages by configuring exchange, routing keys and message options.
- Options can be overwritten on a per-message basis
Installation
npm install gleipnir-publish
Usage
var gleipnir = require('gleipnir');
var getPublisher = require('gleipnir-publish');
var client = gleipnir({
url: 'amqp://some:user@localhost'
});
var publisher = getPublisher(client, {
exchangeName: 'some-exchange',
routingKey: ''
});
// Send to configured exchange with defined routing key
publisher.publish('message content');
// Send directly to a queue
publisher.sendToQueue('some-queue', 'message content');
License
MIT-licensed. See LICENSE.