Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.
/ qwen Public archive

A simple abstraction around AMQP to hide away the icky bits.

License

Notifications You must be signed in to change notification settings

nearform/qwen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qwen

A simple abstraction around AMQP to hide away the icky bits.

Install

To install, simply use npm...

npm install qwen

Testing, linting, & coverage

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.

Usage

'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')
})

Options

{
  // 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
  }
}

License

Copyright nearForm 2016. Licensed under MIT

About

A simple abstraction around AMQP to hide away the icky bits.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published