@lindorm-io/amqp
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

@lindorm-io/amqp

AMQP connection and message bus for lindorm.io packages.

Installation

npm install --save @lindorm-io/mongo

Usage

AMQP Connection

const connection = new AmqpConnection({
  hostname: "amqp.location.com",
  port: 5672,
});

await connection.connect();

Message Bus

const messageBus = new MessageBus({
  connection,
  logger,
});

const callback = async () => {};

await messageBus.subscribe([
  { callback, queue: "1", routingKey: "default.1" },
  { callback, queue: "2", routingKey: "default.2" },
]);

await messageBus.publish([
  {
    id: randomUUID(),
    delay: 0,
    mandatory: true,
    routingKey: "default.1",
    type: "type",
  },
]);

Readme

Keywords

none

Package Sidebar

Install

npm i @lindorm-io/amqp

Weekly Downloads

2

Version

0.3.2

License

AGPL-3.0-or-later

Unpacked Size

59.5 kB

Total Files

72

Last publish

Collaborators

  • princejonn