1.0.1 • Published 8 years ago

gleipnir-assert v1.0.1

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

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.