Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

mq-library

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mq-library

An easy to use library to work with Message Queuing

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
4
Created
Source

MQ-library - Message Queuing Library

Setup

npm install mq-library --save

How to use

Define a configuration


var amqpConfig = {
  connection: {
    host: 'rabbitmq',
    port: 5672,
    vhost: '/',
    user: 'guest',
    pass: 'guest',
    useConfirms: false
  },
  exchanges: [
    {name: 'domain.events', type: 'topic', durable: true},
    {name: 'domain.events.DL', type: 'topic'},
    {name: 'domain.notifs', type: 'fanout', durable: true}
  ],
  queues: [
    {name: 'domain.events.queue', subscribe: true, messageTtl: 60000, deadLetterExchange: 'domain.events.DL'},
    {name: 'domain.notifs.queue', messageTtl: 60000}
  ],
  bindings: [
    {exchange: 'domain.events', target: 'domain.events.queue', keys: ['some.routing.key.*']},
    {exchange: 'domain.notifs', target: 'domain.notifs.queue'}
  ]
};

var mq = require('mq-library')(amqpConfig, logger);

mq.then(function (channel) {
  channel.consume('domain.events.queue', someFancyFunction);
  channel.consume('domain.notifs.queue', someOtherFancyFunction);
});

Changelog

How to publish a new version

npm install npm-release -g
npm-release [major|minor|patch]

npm-release is a little script to help release npm modules. It:

  • Bumps the version in package.json
  • Commits 'Release x.x.x'
  • Tags
  • Pushes to upstream
  • Publish on npm (if private:true is not present in package.json)

Keywords

amqp

FAQs

Package last updated on 08 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts