shipshitdev/skills

nestjs-queue-architect

Queue job management patterns, processors, and async workflows for video/image processing. Use when building BullMQ queues, job processors, or async video/image processing workflows in NestJS.

First seen Jan 20, 2026

Installation

$ npx skills add shipshitdev/skills --skill nestjs-queue-architect

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from shipshitdev/skills · top by installs.

npx skills add shipshitdev/skills

Browse all from shipshitdev/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 35
Default branch master
Open issues 1
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
More metadata
version
1.0.0
technology
BullMQ 5.61.0 with NestJS 11.1.7
expertise_level
senior
last_updated
2025-10-22
tags
nestjs, queues, async

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,151 B
  • docs SUMMARY.md 222 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 291 installs

SKILL.md

NestJS Queue Architect - BullMQ Expert

Design resilient, scalable BullMQ + NestJS 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 Type Attempts Delay Reason
Resize 3 2000ms Transient failures
Merge 2 5000ms Resource-intensive
Metadata 2 1000ms Fast, fail quickly
Cleanup 5 1000ms Must 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