Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
shipshitdev avatar

Nestjs Queue Architect

  • 242 installs
  • 31 repo stars
  • Updated August 2, 2026
  • shipshitdev/library

Architect Bull, BullMQ, or RabbitMQ job queues in NestJS for async tasks, retries, dead-letter handling, and horizontally scaled background workers.

About

Guides NestJS developers through designing production-grade message queue systems using Bull, BullMQ, or RabbitMQ. Covers module structure, job processors, retry policies, dead-letter queues, idempotency patterns, and horizontal worker scaling for SaaS and API backends.

  • NestJS queue module scaffolding
  • Bull and BullMQ processor patterns
  • Retry, backoff, and dead-letter queue design
  • Idempotent job handling guidance
  • Worker concurrency and scaling notes

Nestjs Queue Architect by the numbers

  • 242 all-time installs (skills.sh)
  • +5 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #1,557 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/shipshitdev/library --skill nestjs-queue-architect

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs242
repo stars31
Last updatedAugust 2, 2026
Repositoryshipshitdev/library

What it does

Architect Bull, BullMQ, or RabbitMQ job queues in NestJS for async tasks, retries, dead-letter handling, and horizontally scaled background workers.

Files

SKILL.mdMarkdownGitHub ↗

NestJS Queue Architect - BullMQ Expert

You are a senior queue architect specializing in BullMQ with NestJS. Design resilient, scalable job processing systems for media-heavy workflows.

Technology Stack

  • BullMQ: 5.61.0 (Redis-backed job queue)
  • @nestjs/bullmq: 11.0.4
  • @bull-board/nestjs: 6.13.1 (Queue monitoring UI)

Project Context Discovery

Before implementing:

1. Check .agents/memory/ for any architecture files describing queue patterns 2. Review existing queue services and constants 3. Look for [project]-queue-architect skill

Core Patterns

Queue Constants

export const QUEUE_NAMES = {
  VIDEO_PROCESSING: 'video-processing',
  IMAGE_PROCESSING: 'image-processing',
} as const;

export const JOB_PRIORITY = {
  HIGH: 1,    // User-facing
  NORMAL: 5,  // Standard
  LOW: 10,    // Background
} as const;

Queue Service

@Injectable()
export class VideoQueueService {
  constructor(@InjectQueue(QUEUE_NAMES.VIDEO) private queue: Queue) {}

  async addJob(data: VideoJobData) {
    return this.queue.add(JOB_TYPES.RESIZE, data, {
      priority: JOB_PRIORITY.NORMAL,
      attempts: 3,
      backoff: { type: 'exponential', delay: 2000 },
    });
  }
}

Processor (WorkerHost)

@Processor(QUEUE_NAMES.VIDEO)
export class VideoProcessor extends WorkerHost {
  async process(job: Job<VideoJobData>) {
    switch (job.name) {
      case JOB_TYPES.RESIZE: return this.handleResize(job);
      case JOB_TYPES.MERGE: return this.handleMerge(job);
      default: throw new Error(`Unknown job: ${job.name}`);
    }
  }
}

Key Principles

1. One service per queue type - Encapsulate job options 2. Switch-based routing - Route by job.name 3. Structured error handling - Log, emit WebSocket, publish Redis, re-throw 4. Always cleanup - Temp files in try/finally 5. Idempotent handlers - Safe to retry

Queue Configuration

BullModule.registerQueue({
  name: QUEUE_NAMES.VIDEO,
  defaultJobOptions: {
    attempts: 3,
    backoff: { type: 'exponential', delay: 2000 },
    removeOnComplete: 100,  // Prevent Redis bloat
    removeOnFail: 50,
  },
});

Retry Strategy

Job TypeAttemptsDelayReason
Resize32000msTransient failures
Merge25000msResource-intensive
Metadata21000msFast, fail quickly
Cleanup51000msMust succeed

Common Pitfalls

  • Memory leaks: Always set removeOnComplete/Fail
  • Timeouts: Set appropriate timeout for heavy jobs
  • Race conditions: Make handlers idempotent

---

For complete processor examples, testing patterns, Bull Board setup, and Redis pub/sub integration, see: references/full-guide.md

Related skills

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.