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

@nathapp/nestjs-queue

v3.3.0

Published

NestJS Queue Module with multi-provider support (BullMQ, Kafka, RabbitMQ, Redis Pub/Sub)

Readme

@nathapp/nestjs-queue

Multi-provider queue abstraction for NestJS — BullMQ, Kafka, and RabbitMQ behind one IQueueProvider interface, with decorator-based processors, idempotency, circuit breaking, and delayed-job scheduling.

Installation

npm install @nathapp/nestjs-queue

Install the client library for whichever provider you use (e.g. bullmq + ioredis, kafkajs, or amqplib) as a peer dependency. This package is part of the @nathapp/nestjs-* peer-layer stack and builds on @nathapp/nestjs-common.

What it provides

  • QueueModuleregister() / registerAsync() for full processing mode (wires QueueService + ProcessorExplorer for @Processor/@Process decorators); forProducer() / forProducerAsync() for producer-only mode (just QueueService, no decorator scanning).
  • QueueServiceadd, addBulk, process, getJob, getJobs, removeJob, pause, resume, and cleanup methods, delegating to the configured IQueueProvider.
  • QueueProviderType enum — BULLMQ, KAFKA, RABBITMQ, CUSTOM.
  • Decorators — @Processor(queueName | options) (class) and @Process(name? | options) (method) to declare job handlers; @OnQueueEvent, @BatchProcess for event hooks and batch processing.
  • Interfaces — IJob<T>, JobOptions, IQueueProvider, QueueModuleOptions, QueueModuleAsyncOptions, HealthCheckResult, IdempotencyStoreOptions.
  • Utilities — DelayedJobScheduler, QueueError, ShutdownOptions, sanitization/validation helpers, an InMemoryIdempotencyStore (under store), and a Redis-backed idempotency store (under utils).
  • Circuit breaking — QueueModuleOptions.circuitBreaker (global) and JobOptions.circuitBreaker (per-processor, via @Processor) accept a circuit-breaker config object to guard against cascading failures. The breaker implementation and its option/state/metrics types are internal and not part of the package's exported surface.

Provider implementations (BullMQ/Kafka/RabbitMQ) are lazy-loaded internally and are not part of the package's static export surface — select one via provider: QueueProviderType.<X> in the module options.

Usage

Register a queue and declare a processor:

import { Module } from '@nestjs/common';
import { QueueModule, Processor, Process, IJob } from '@nathapp/nestjs-queue';
import { QueueProviderType } from '@nathapp/nestjs-queue';

@Module({
  imports: [
    QueueModule.register({
      provider: QueueProviderType.BULLMQ,
      options: { connection: { host: 'redis', port: 6379 } },
    }),
  ],
  providers: [EmailProcessor],
})
export class AppModule {}

@Processor('email-queue')
export class EmailProcessor {
  @Process('send')
  async handleSend(job: IJob<{ to: string }>) {
    // ... send email
  }
}

To only enqueue jobs (no local processing), use producer-only mode:

QueueModule.forProducer({
  provider: QueueProviderType.BULLMQ,
  options: { connection: { host: 'redis', port: 6379 } },
});
import { Injectable } from '@nestjs/common';
import { QueueService } from '@nathapp/nestjs-queue';

@Injectable()
export class EmailQueueClient {
  constructor(private readonly queue: QueueService) {}

  enqueue(to: string) {
    return this.queue.add('email-queue', 'send', { to });
  }
}