⌨️ Codingadvancedqueuebackground-jobsbullmqredisworkers

Implement a Background Job Queue

Set up a background job queue with retry logic, concurrency control, and job monitoring.

The Prompt

prompt.txt
Implement a background job queue for the following requirements:
1. Job producer — add jobs from API handlers
2. Job consumer — worker that processes jobs
3. Retry logic — exponential backoff with max retries
4. Concurrency — process N jobs in parallel
5. Priority queues — high-priority jobs processed first
6. Dead letter queue — failed jobs after max retries
7. Job status tracking — pending, active, completed, failed

Queue library: [BULL/BULLMQ / CELERY / BEE-QUEUE — specify]
Backed by: [REDIS / POSTGRES]

Use case: [DESCRIBE — e.g., Email sending, image processing, PDF generation, webhook delivery]

Example Output

Implemented BullMQ-based email queue with 3 concurrency workers, exponential backoff starting at 1s (max 5 retries), a separate high-priority queue for transactional emails, a dead letter queue that sends to Slack, and a /api/admin/jobs status endpoint.

FAQ

Which AI model is best for Implement a Background Job Queue?

Claude Sonnet 4 — strong on distributed systems and reliability patterns.

How do I use the Implement a Background Job Queue prompt?

Copy the prompt, replace the [BRACKETED] placeholders with your specific information, and paste into your preferred AI assistant (ChatGPT, Claude, Gemini, etc.). Implemented BullMQ-based email queue with 3 concurrency workers, exponential backoff starting at 1s (max 5 retries), a separate high-priority queue for transactional emails, a dead letter queue that sends to Slack, and a /api/admin/jobs status endpoint.