Skip to content

coders51/rabbitmq-amqp-js-client

Repository files navigation

RabbitMQ AMQP 1.0 JavaScript Client

This library is meant to be used with RabbitMQ 4.0.
Suitable for testing in pre-production environments. The public API(s) could change.

Build Status

Table of Contents

Installing via npm

The client is distributed via npm:

 npm install rabbitmq-amqp-js-client

Getting started

NOTE: This is just a first example and will be replaced with a reference to the examples folder

The following example demonstrates how to create an environment, open a connection, and use the management to create and delete queues, exchanges, and bindings.

const environment = createEnvironment({ host: "localhost", port: 5672, username: "rabbit", password: "rabbit", }) const connection = await environment.createConnection() const management = connection.management() const queue = await management.declareQueue("test") const exchange = await management.declareExchange("exchange", { type: "topic" }) const secondExchange = await management.declareExchange("exchange-dest", { type: "topic" }) const bindingToQueue = await management.bind("foo", { source: exchange, destination: queue }) const bindingToExchange = await management.bind("foo", { source: exchange, destination: secondExchange }) await management.unbind("foo", { source: exchange, destination: queue }) await management.unbind("foo", { source: exchange, destination: secondExchange }) await management.deleteExchange("exchange") await management.deleteExchange("exchange-dest") await management.deleteQueue("test") management.close() await connection.close() await environment.close()

Resources

Roadmap

The interface shall be uniformed to all other clients in order to have unified documentation. While developing, keep in mind the support for autoreconnect.

  1. Implement the management functions via AMQP

    • "REST style" send message
    • handling senderLink, receiverLink
    • generating exchanges, queues, bindings
  2. Implementing connections

  3. Implementing environment

  4. Provide simple APIs for publishing and consuming

  5. (OPTIONAL) Autoreconnect (possibly already managed by RHEA)

  6. (OPTIONAL) Metrics for Prometheus

About

node.js RabbitMQ client for AMQP 1.0

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages