Skip to content

aichbauer/pipefi

Repository files navigation

pipefi

Build Status

A library for simple RabbitMQ filters

Installation

$ npm i pipefi

Usage

Note: Only works with Node v8+

Take a look at the example

const pipefi = require('pipefi');

const config = require('path/to/config');

pipefi(config);

Config

connection

Type: object

The connection object consists of 4 properties:

  • user (string)
  • password (string)
  • host (string)
  • port (number)

Example:

{
  connection: {
    user: 'guest',
    password: 'guest',
    host: 'localhost',
    port: 5672,
  },
}

pipes

Type: array

Pipes consists of an array of objects. One object consists of 3 different properties:

  • from (string)
  • to (string)
  • filter (function)

Example:

{
  pipes: [
    {
      from: 'filterOne',
      to: 'filterTwo',
      filter: (msg) => msg, // do something with the message
    },
  ],
}

LICENSE

MIT © Aichbauer Lukas, Stoecklmair Jan Peer