2.0.0 • Published 7 years ago

gleipnir-publish v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

npm versionBuild StatusCoverage StatusCode Climate

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.