bullmq-specialist
Skill này làm gì
Chuyên gia này giúp tổ chức các tác vụ cần thực hiện ở nền của một ứng dụng. Nó đảm bảo các tác vụ này chạy đáng tin cậy, ngay cả khi ứng dụng cần khởi động lại.
Khi nào nên dùng
- ✓Khi bạn cần lên lịch để tác vụ chạy sau.
- ✓Khi bạn có nhiều tác vụ và cần xử lý theo từng lô.
- ✓Khi bạn muốn theo dõi tiến độ của các tác vụ.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/bullmq-specialist/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm thế nào để thiết lập một hàng đợi để gửi email ở nền?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng một hệ thống tên BullMQ, quản lý một danh sách tác vụ (hàng đợi) và các worker thực thi các tác vụ này. Bạn xác định cách tác vụ chạy, và hệ thống lo phần còn lại.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
BullMQ Specialist
BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications.
Principles
- Jobs are fire-and-forget from the producer side - let the queue handle delivery
- Always set explicit job options - defaults rarely match your use case
- Idempotency is your responsibility - jobs may run more than once
- Backoff strategies prevent thundering herds - exponential beats linear
- Dead letter queues are not optional - failed jobs need a home
- Concurrency limits protect downstream services - start conservative
- Job data should be small - pass IDs, not payloads
- Graceful shutdown prevents orphaned jobs - handle SIGTERM properly
Capabilities
- bullmq-queues
- job-scheduling
- delayed-jobs
- repeatable-jobs
- job-priorities
- rate-limiting-jobs
- job-events
- worker-patterns
- flow-producers
- job-dependencies
Scope
- redis-infrastructure -> redis-specialist
- serverless-queues -> upstash-qstash
- workflow-orchestration -> temporal-craftsman
- event-sourcing -> event-architect
- email-delivery -> email-systems
Tooling
Core
- bullmq
- ioredis
Hosting
- upstash
- redis-cloud
- elasticache
- railway
Monitoring
- bull-board
- arena
- bullmq-pro
Patterns
- delayed-jobs
- repeatable-jobs
- job-flows
- rate-limiting
- sandboxed-processors
Patterns
Basic Queue Setup
Production-ready BullMQ queue with proper configuration
When to use: Starting any new queue implementation
import { Queue, Worker, QueueEvents } from 'bullmq'; import IORedis from 'ioredis';
// Shared connection for all queues const connection = new IORedis(process.env.REDIS_URL, { maxRetriesPerRequest: null, // Required for BullMQ enableReadyCheck: false, });
// Create queue with sensible defaults const emailQueue = new Queue('emails', { connection, defaultJobOptions: { attempts: 3, backoff: { type: 'exponential', delay: 1000, }, removeOnComplete: { count: 1000 }, removeOnFail: { count: 5000 }, }, });
// Worker with concurrency limit const worker = new Worker('emails', async (job) => { await sendEmail(job.data); }, { connection, concurrency: 5, limiter: { max: 100, duration: 60000, // 100 jobs per minute }, });
// Handle events
worker.on('failed', (job, err) => {
console.error(Job ${job?.id} failed:, err);
});
Delayed and Scheduled Jobs
Jobs that run at specific times or after delays
When to use: Scheduling future tasks, reminders, or timed actions
// Delayed job - runs once after delay await queue.add('reminder', { userId: 123 }, { delay: 24 * 60 * 60 * 1000, // 24 hours });
// Repeatable job - runs on schedule await queue.add('daily-digest', { type: 'summary' }, { repeat: { pattern: '0 9 * * *', // Every day at 9am tz: 'America/New_York', }, });
// Remove repeatable job await queue.removeRepeatable('daily-digest', { pattern: '0 9 * * *', tz: 'America/New_York', });
Job Flows and Dependencies
Complex multi-step job processing with parent-child relationships
When to use: Jobs depend on other jobs completing first
import { FlowProducer } from 'bullmq';
const flowProducer = new FlowProducer({ connection });
// Parent waits for all children to complete await flowProducer.add({ name: 'process-order', queueName: 'orders', data: { orderId: 123 }, children: [ { name: 'validate-inventory', queueName: 'inventory', data: { orderId: 123 }, }, { name: 'charge-payment', queueName: 'payments', data: { orderId: 123 }, }, { name: 'notify-warehouse', queueName: 'notifications', data: { orderId: 123 }, }, ], });
Graceful Shutdown
Properly close workers without losing jobs
When to use: Deploying or restarting workers
const shutdown = async () => { console.log('Shutting down gracefully...');
// Stop accepting new jobs await worker.pause();
// Wait for current jobs to finish (with timeout) await worker.close();
// Close queue connection await queue.close();
process.exit(0); };
process.on('SIGTERM', shutdown); process.on('SIGINT', shutdown);
Bull Board Dashboard
Visual monitoring for BullMQ queues
When to use: Need visibility into queue status and job states
import { createBullBoard } from '@bull-board/api'; import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
…
Câu hỏi thường gặp
“Jobs” là gì?
“Jobs” (công việc) là các tác vụ riêng lẻ mà bạn muốn hệ thống thực hiện ở nền.
“Idempotency” nghĩa là gì?
Nghĩa là chạy một tác vụ nhiều lần cũng có kết quả giống như chạy một lần. Bạn cần đảm bảo các tác vụ của mình có tính idempotent.
Vì sao việc xử lý “graceful shutdown” lại quan trọng?
Để đảm bảo không tác vụ đang chạy nào bị mất khi ứng dụng khởi động lại hoặc tắt.
Chi tiết
Mô tả gốc của tác giả
BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4083
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.