Job options (delay, attempts, priority) in NestJS Bull Queue
📖 Scenario: You are building a task queue in a NestJS application to process background jobs like sending emails or generating reports. You want to control when jobs run, how many times they retry on failure, and their priority in the queue.
🎯 Goal: Create a Bull queue job in NestJS with specific job options: a delay of 5000 milliseconds, 3 retry attempts, and priority level 2.
📋 What You'll Learn
Create a Bull queue job data object with a
task property set to 'sendEmail'Define a job options object with
delay set to 5000, attempts set to 3, and priority set to 2Add the job to the queue using the data and options objects
Use the
bull package and NestJS Bull integration patterns💡 Why This Matters
🌍 Real World
Background job processing is common in web apps to handle tasks like sending emails, processing images, or generating reports without blocking user requests.
💼 Career
Understanding job options like delay, attempts, and priority is essential for backend developers working with task queues to build reliable and efficient systems.
Progress0 / 4 steps