Enterprise-grade request queue for NestJS with Redis support, retries, priorities, and rate limiting. Current stable version is 1.2.1, released under MIT license. This package provides a NestJS module for managing request queues with features like rate limiting per queue, per-key isolation, priority-based execution, retry with exponential backoff, job timeout handling, and cancelation. It supports both in-memory (default) and Redis-backed storage for persistence and distributed events across nodes via Redis Pub/Sub. Key differentiators include typed event streams via RxJS Observable, queue introspection, and support for both function-based and Axios-based jobs. Requires NestJS 9+, reflect-metadata, and rxjs 7+. Ships with TypeScript types and supports dynamic/async module configuration. Suitable for production scenarios where throttling, job queuing, and rate limiting are needed within a NestJS application.
npm install smart-request-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic NestJS module setup with in-memory queue and a service that adds a job to the 'api' queue with priority.
Use ES module imports (import { ... } from 'smart-request-queue') in TypeScript or Node ESM mode.Update imports to the new API; refer to v1 migration guide.
Check Redis connectivity and credentials. Use environment variables for configuration.
Use only one of 'axios' or 'fn' per job.
Always provide a 'key' when per-user/per-tenant isolation is required.
Run npm install smart-request-queue and ensure it's in package.json dependencies.
Inject via constructor: constructor(private queue: QueueService) {}Add the queue name to the requests array in the module configuration.
Make sure QueueModule is imported in your module and that the service using QueueService is in the same module context.