1.1.4 • Published 1 year ago

@clickheredigital/amqp v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

AMQP

This library provides a shortcut for interacting with an AMQP-based message queue (RabbitMQ, for example).

Getting Started

Installation

npm i @clickheredigital/amqp

Usage

import { Publisher } from "./src";

(async () => {
  const pub: Publisher = new Publisher("amqp://localhost");

  try {
    // initialize the connection
    await pub.connect();

    // send a message to the AMQP message queue
    // the send function takes optional parameters `queueOpts` and `messageOpts`
    await pub.send("test", JSON.stringify({ message: "hello world" }));
  } catch (error) {
    console.error(error);
  } finally {
    // close the connection
    await pub.close();
  }
})();
1.1.4

1 year ago

1.1.3

1 year ago

1.1.1

1 year ago

1.1.2

1 year ago

1.1.0

2 years ago

1.0.0

2 years ago