gleipnir-assert

1.0.1 • Public • Published

npm versionBuild StatusCoverage StatusCode Climate

gleipnir-assert

Gleipnir module that asserts exchanges, queues and bindings

Installation

npm install gleipnir-assert

Usage

If you're using gleipnir, this functionality is already baked in. Simply pass assert to the options when constructing it:

var gleipnir = require('gleipnir');
 
var client = gleipnir({
    url: 'amqp://some:user@localhost',
    assert: {
        queues: [
            { name: 'foo' },
            { name: 'bar', options: { exclusive: true } }
        ],
        exchanges: [
            { name: 'some-tasks', type: 'topic' },
            { name: 'other-tasks', type: 'fanout' }
        ],
        bindings: [
            { queue: 'foo', exchange: 'other-tasks' }
        ]
    }
});

If you just use the amqplib lib directly, you can use it like this:

var gleipnirAssert = require('gleipnir-assert');
 
gleipnirAssert(someAmqpChannel, assertions, function(err) {
    // Remember to check for errors!
    if (err) {
        throw err;
    }
 
    // Good to go!
});

License

MIT-licensed. See LICENSE.

Package Sidebar

Install

npm i gleipnir-assert

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • rexxars