npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@connectum/events-amqp

v1.0.0-rc.9

Published

AMQP/RabbitMQ adapter for @connectum/events

Readme

@connectum/events-amqp

AMQP/RabbitMQ adapter for @connectum/events.

@connectum/events-amqp connects the Connectum EventBus to RabbitMQ (AMQP 0-9-1) for durable, at-least-once event delivery with topic exchanges, consumer groups, and dead-letter support.

Layer: 2 (Tools) | Node.js: >=20.0.0 | License: Apache-2.0

Features

  • Topic Exchange -- flexible routing via AMQP topic exchange with wildcard patterns
  • Consumer Groups -- load-balanced consumption via named queues (competing consumers)
  • Publisher Confirms -- optional synchronous publishing with broker acknowledgement
  • Dead Letter Exchange -- built-in DLX support for rejected messages
  • Metadata as Headers -- event metadata mapped to AMQP message headers
  • Prefetch Control -- configurable QoS prefetch count per consumer

Installation

pnpm add @connectum/events-amqp

Peer dependencies:

pnpm add @connectum/events

Quick Start

import { createEventBus } from '@connectum/events';
import { AmqpAdapter } from '@connectum/events-amqp';

const bus = createEventBus({
  adapter: AmqpAdapter({
    url: 'amqp://guest:guest@localhost:5672',
  }),
  routes: [eventRoutes],
});

await bus.start();

With Full Options

const bus = createEventBus({
  adapter: AmqpAdapter({
    url: 'amqp://guest:guest@localhost:5672',
    exchange: 'my-service.events',
    exchangeType: 'topic',
    exchangeOptions: {
      durable: true,
      autoDelete: false,
    },
    queueOptions: {
      durable: true,
      messageTtl: 60000,
      maxLength: 100000,
      deadLetterExchange: 'dlx.events',
      deadLetterRoutingKey: 'dlq',
    },
    consumerOptions: {
      prefetch: 20,
    },
    publisherOptions: {
      persistent: true,
    },
  }),
  routes: [eventRoutes],
  group: 'worker-group',
  middleware: {
    retry: { maxRetries: 3 },
    dlq: { topic: 'service.dlq' },
  },
});

API Reference

AmqpAdapter()

import { AmqpAdapter } from '@connectum/events-amqp';

function AmqpAdapter(options: AmqpAdapterOptions): EventAdapter

AmqpAdapterOptions

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | url | string | required | AMQP connection URL | | socketOptions | Record<string, unknown> | undefined | Socket options for connection | | exchange | string | 'connectum.events' | Exchange name | | exchangeType | 'topic' \| 'direct' \| 'fanout' \| 'headers' | 'topic' | Exchange type | | exchangeOptions | AmqpExchangeOptions | {} | Exchange assertion options | | queueOptions | AmqpQueueOptions | {} | Queue assertion options | | consumerOptions | AmqpConsumerOptions | {} | Consumer options | | publisherOptions | AmqpPublisherOptions | {} | Publisher options |

AmqpExchangeOptions

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | durable | boolean | true | Survive broker restarts | | autoDelete | boolean | false | Delete when last queue unbinds |

AmqpQueueOptions

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | durable | boolean | true | Survive broker restarts | | messageTtl | number | undefined | Per-message TTL in ms | | maxLength | number | undefined | Max messages in queue | | deadLetterExchange | string | undefined | DLX exchange name | | deadLetterRoutingKey | string | undefined | DLX routing key |

AmqpConsumerOptions

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | prefetch | number | 10 | QoS prefetch count | | exclusive | boolean | false | Exclusive consumer |

AmqpPublisherOptions

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | persistent | boolean | true | Persist messages (deliveryMode=2) | | mandatory | boolean | false | Return unroutable messages |

How It Works

Topic Mapping

Event types are mapped to AMQP routing keys on the configured exchange:

EventType:    "user.created"
Exchange:     "connectum.events"
Routing Key:  "user.created"

Wildcard Conversion

EventBus wildcard patterns are converted to AMQP topic patterns:

EventBus  →  AMQP
*         →  *     (single token -- same in both)
>         →  #     (multi-token greedy match)

Example: "order.>"  →  "order.#"

Consumer Groups

| Mode | Queue Name | Behavior | |------|-----------|----------| | With group | {exchange}.{group} | Shared, durable, competing consumers | | Without group | {exchange}.sub-{uuid} | Exclusive, auto-delete (fan-out) |

Metadata

Event metadata is transmitted as AMQP message headers. Internal headers (x-event-id, x-published-at) are set on publish and stripped from metadata on delivery.

Publisher Confirms

When publishOptions.sync: true, the adapter uses ConfirmChannel.waitForConfirms() to wait for broker acknowledgement before returning.

Dependencies

External

  • amqplib -- AMQP 0-9-1 client for Node.js

Peer

  • @connectum/events -- EventBus core

Requirements

  • Node.js: >=20.0.0
  • RabbitMQ: >=3.8

Documentation

License

Apache-2.0


Part of @connectum -- Universal framework for production-ready gRPC/ConnectRPC microservices