1.2.0 • Published 3 years ago

feathers-amqp-events-publish v1.2.0

Weekly downloads
20
License
ISC
Repository
github
Last release
3 years ago

Build Status

FeathersJS AMQP events

Publish service events with using AMQP protocol. Supports reconnect on lost connection.

Usage

const feathers = require('@feathersjs/feathers');
const express = require('@feathersjs/express');
const services = require('./services');
const amqpEvents = require('feathers-amqp-events');
const app = express(feathers());

app.use(express.json())
  .use(express.urlencoded({ extended: true }))
  .configure(express.rest())
  .configure(services())
  .configure(amqpEvents({
    amqp: {
      url: 'amqp://localhost', // url to your RabbitMQ connection
      exchange: 'my-app'       // all events will be published to this exchange
      retryOptions: { max_tries: 100, interval: 500 } // bluebird-retry options for reconnect
    },
    original: true ,            // publish object before update or not
    // the following are optional. No need to set them if you want to publish all of your services to RabbitMQ
    services: ['allow-this-service'],  // optional. To only allow specific services to be published to RabbitMQ
    ignoreServices: ['ignore-this-service']  // optional. To stop specific services from being published to RabbitMQ
  }));

module.exports = app;

Events

Routing key for every event will looks like <path>.<event>. For example:

  • posts.created
  • posts.updated
  • posts.removed
  • posts/:id/comments.created
  • posts/:id/comments.updated
  • posts/:id/comments.removed

Content

Message content will have following fields:

  • data - created, removed or updated object.
  • original - object before update.
1.2.0

3 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.3.11

6 years ago

0.4.9

7 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago