A simple abstraction around AMQP to hide away the icky bits.
To install, simply use npm...
npm install qwen
This module can be tested and reported on in a variety of ways...
npm run test # runs TAP based unit test suite.
npm run integration # runs TAP based integration suite.
npm run coverage # generates and opens a coverage report.
npm run lint # lints via standardJS.
npm run validate # runs test, integration, and lint.
Note: integration
and validate
require a valid .env
file. Details on how to create this are below.
'use strict'
const Config = require('./config')
const Qwen = require('qwen')
const qwen = Qwen(Config.qwen)
.use(require('./service-one'), Config.serviceOne)
.use(require('./service-two'), Config.serviceTwo)
.use(require('./service-three'), Config.serviceThree)
qwen.start((err) => {
if (!err) {
qwen.log.error(err)
process.exit(1)
}
qwen.info.log('server started')
})
{
// A tag that can be used to identify and group services
tag: 'untagged',
// A collection of schemas for validating published and subscribes.
schema: {
},
// Options for rabbitmq.
rabbit: {
// The url to connect to.
url: 'amqp://rabbitmq:rabbitmq@localhost',
// The max number of attempts to connect before failing.
maxRetries: 10
}
}
Copyright nearForm 2016. Licensed under MIT