2.0.0 • Published 3 years ago

@datapio/sdk-amqp-engine v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

Datapio SDK AMQP Engine

The Datapio SDK AMQP Engine provides a declarative way to setup AMQP exchanges, queues, producers and consumers.

Installation

$ npm install @datapio/sdk-amqp-engine

Usage

The SDK provides an Engine class that you can inherit from:

import { Engine } from '@datapio/sdk-amqp-engine'

class MyEngine extends Engine {
  constructor() {
    super({
      /* options */
    })
  }
}

You can then instantiate and use your engine:

const engine = new MyEngine()

// setup exchanges and queues
await engine.declare()

// start consuming in background
await engine.consume()

// will stop consuming and close the connection
await engine.shutdown()