RabbitMQ HTTP API Client

0.0.4 · abandoned · verified Wed Apr 22

This library, `http-rabbitmq-manager`, is a Node.js client designed to interact with the RabbitMQ HTTP API. As of version 0.0.4, with its last commit over seven years ago, the package is considered abandoned and no longer actively maintained. It provides a programmatic interface for management and monitoring tasks such as retrieving cluster overview, listing nodes, connections, channels, consumers, and exchanges, and setting cluster definitions. A significant limitation is its official support for only RabbitMQ 3.x, while the current stable RabbitMQ version is 4.2.5. This means it may not be compatible with newer RabbitMQ installations or features. The library's functionality relies heavily on the RabbitMQ Management UI plugin being installed and enabled on the RabbitMQ server. The API uses traditional Node.js callback patterns for asynchronous operations, which differs from modern Promise-based or `async/await` paradigms. For current RabbitMQ monitoring, official documentation now recommends tools like Prometheus and Grafana over direct HTTP API scraping for long-term data collection.

Common errors

Warnings

Install

Imports

Quickstart

Instantiate the client and demonstrate fetching basic RabbitMQ cluster information (overview, nodes, connections) using callbacks.

const client = require('http-rabbitmq-manager').client({
  host: process.env.RABBITMQ_HOST ?? 'localhost',
  port: parseInt(process.env.RABBITMQ_MANAGEMENT_PORT ?? '15672'),
  timeout: parseInt(process.env.RABBITMQ_TIMEOUT ?? '25000'),
  user: process.env.RABBITMQ_USER ?? 'guest',
  password: process.env.RABBITMQ_PASSWORD ?? 'guest'
});

console.log('Fetching RabbitMQ cluster overview...');
client.overview(function (err, res) {
  if (err) {
    console.error('Error fetching overview:', err.message);
    return;
  }
  console.log('Overview:', JSON.stringify(res, null, 2));

  console.log('\nListing all nodes...');
  client.listNodes(function (err, nodes) {
    if (err) {
      console.error('Error listing nodes:', err.message);
      return;
    }
    console.log('Nodes:', JSON.stringify(nodes, null, 2));

    console.log('\nListing all connections...');
    client.listConnections(function (err, connections) {
      if (err) {
        console.error('Error listing connections:', err.message);
        return;
      }
      console.log('Connections:', JSON.stringify(connections, null, 2));
    });
  });
});

view raw JSON →