The Datapio SDK AMQP Engine provides a declarative way to setup AMQP exchanges, queues, producers and consumers.
$ npm install @datapio/sdk-amqp-engine
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()
Generated using TypeDoc