Abhishek-Mallick/universal-box

[TEMPLATE] - Node.js + Bull.js + Redis | Job Queues

Open

#161 opened on Oct 19, 2024

 (0 comments) (0 reactions) (0 assignees)JavaScript (41 forks)auto 404
hacktoberfest

Repository metrics

Stars
 (49 stars)
PR merge metrics
 (PR metrics pending)

Description

What domain will the project template be based on?

Others (please specify in the details)

If 'Others', please specify the preferred domain.

Job Queues

Particular directory path for the template.

templates/Job-Queues/Node-Bull-Redis/

What tech stacks do you want to include?

Node.js, Bull.js, Redis, Express.js, Bull Board or Arena

Brief Description

This template demonstrates how to implement background processing in a Node.js application using Bull.js and Redis. It includes examples of creating job queues, processing jobs, and monitoring job statuses. This setup is ideal for handling tasks like sending emails, processing images, or any CPU-intensive operations without blocking the main thread.

Key Features:

  1. Queue Configuration: Set up Bull queues connected to Redis for job management.
  2. Job Producers: Implement API endpoints or services that add jobs to the queue.
  3. Job Consumers: Create worker processes that consume and process jobs.
  4. Monitoring Dashboard: Integrate Bull Board or Arena for real-time monitoring of the queues.
  5. Error Handling: Implement retries, error logging, and failover mechanisms.
  6. Graceful Shutdown: Ensure the application can shut down gracefully without losing jobs.

Contributor Tasks:

  • Set up the Express.js server with endpoints for adding jobs.
  • Implement sample jobs (e.g., email sending, data processing) with detailed comments.
  • Configure the worker processes and ensure they handle concurrency properly.
  • Integrate a monitoring tool and include instructions on accessing it.
  • Write tests for job creation and processing using a testing framework like Jest.
  • Update the README with setup instructions, including Redis installation and configuration.
  • Create a corresponding markdown for populating docs in website/content/Templates/Job-Queues/Node-Bull-Redis.md .. refer to this one for getting an idea on the format to follow

👀 Have you spent some time checking if this issue has been raised before?

  • Yes
  • No

🏢 Have you read the Code of Conduct?

Would you like to work on this issue?

No

Contributor guide