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

@anabranch/queue-rabbitmq

v0.2.12

Published

RabbitMQ adapter for @anabranch/queue using amqplib. Supports all queue features with RabbitMQ queues for persistent messaging.

Downloads

1,716

Readme

@anabranch/queue-rabbitmq

RabbitMQ adapter for @anabranch/queue using amqplib.

Usage

import { Queue } from '@anabranch/queue'
import { createRabbitMQ } from '@anabranch/queue-rabbitmq'

const connector = createRabbitMQ('amqp://localhost:5672')
const queue = await Queue.connect(connector).run()

await queue.send('notifications', { userId: 123, type: 'welcome' })

const { successes, errors } = await queue
  .stream('notifications')
  .withConcurrency(5)
  .map(async (msg) => await sendNotification(msg.data))
  .partition()

await queue.close().run()

API

createRabbitMQ(options)

Creates a RabbitMQ queue connector.

import { createRabbitMQ } from '@anabranch/queue-rabbitmq'

const connector = createRabbitMQ({
  connection: 'amqp://localhost:5672',
  prefix: 'myapp',
  queues: {
    orders: {
      maxAttempts: 5,
      deadLetterQueue: 'orders-dlq',
    },
  },
  defaultPrefetch: 10,
})

Options:

  • connection - RabbitMQ URL or amqplib connection options
  • prefix - Key prefix for queue names (default: "abq")
  • queues - Per-queue configuration
  • defaultPrefetch - Default prefetch count (default: 10)

Message Headers

Headers can be attached to messages for routing and correlation:

await queue.send('orders', order, {
  headers: {
    'x-correlation-id': 'abc-123',
    'x-source': 'checkout-service',
  },
}).run()

Headers are surfaced in metadata.headers on received messages.

Delayed Messages

Note: Delayed messages require the rabbitmq-delayed-message-exchange plugin. Without it, specifying delayMs will throw an error.

await queue.send('notifications', reminder, { delayMs: 30_000 }).run()

Dead Letter Queue

const connector = createRabbitMQ({
  connection: 'amqp://localhost:5672',
  queues: {
    orders: {
      maxAttempts: 3,
      deadLetterQueue: 'orders-dlq',
    },
  },
})

When a message exceeds max delivery attempts, it is routed to the dead letter queue with metadata about the original message.

Attempt Counting

Attempt counts are tracked in the message envelope and incremented when a message is nacked with requeue: true. This works with all RabbitMQ versions and queue types (classic or quorum).

Requirements

  • RabbitMQ 3.8+ (for x-delivery-count support)
  • For delayed messages: rabbitmq-delayed-message-exchange plugin

Environment Variables

  • RABBITMQ_URL - Default connection URL when no options provided (default: amqp://localhost:5672)