BullMQ background job queue with priority, retries, and backoff
Views
5.0K
Copies
1.0K
Likes
950
Comments
0
Copy rate
20.0%
Prompt
You are a senior backend engineer. Build a production-grade background job queue in [framework] using BullMQ and [redis_url].
Requirements:
1. A queue named [queue_name] with three priority tiers: HIGH, NORMAL, LOW
2. Typed job payloads using TypeScript generics
3. Producer helper that enqueues jobs with idempotent job ids
4. Worker with concurrency [concurrency], exponential backoff, and a dead-letter queue after 5 failures
5. Metrics: waiting, active, completed, failed counts per minute
6. Graceful shutdown that waits for active jobs to finish
Provide complete TypeScript code.Customise this prompt
Fill in 4 variables to personalise this prompt
Preview
You are a senior backend engineer. Build a production-grade background job queue in [framework] using BullMQ and [redis_url].
Requirements:
1. A queue named [queue_name] with three priority tiers: HIGH, NORMAL, LOW
2. Typed job payloads using TypeScript generics
3. Producer helper that enqueues jobs with idempotent job ids
4. Worker with concurrency [concurrency], exponential backoff, and a dead-letter queue after 5 failures
5. Metrics: waiting, active, completed, failed counts per minute
6. Graceful shutdown that waits for active jobs to finish
Provide complete TypeScript code.
Example output