Skip to content

Implementing a design pattern which is leveraging message queues via redis mqs

Notifications You must be signed in to change notification settings

PrakharSinha-09/Redis_Nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Redis Queues Implementation with Node.js (Express Backend)

This project demonstrates how to implement Redis queues using a Node.js backend with Express. The setup includes running Redis on Docker, starting an Express server, and managing worker services.

Prerequisites

Getting Started

Step 1: Start Redis with Docker

First, you need to start a Redis instance using Docker. Open your terminal and run the following command:

docker run --name my-redis -d -p 6379:6379 redis
This command pulls the Redis Docker image (if not already available) and runs it, exposing Redis on port 6379.

Step 2: Set Up the Express Backend

Navigate to the express-backend folder and install the necessary dependencies:

cd express-backend
npm install

After installing the dependencies, start the Express server:

node dist/index.js

Step 3: Set Up the Worker Service

Navigate to the worker folder and install the dependencies:

cd ../worker
npm install

Start the worker service by running:

node dist/index.js

You can start multiple worker instances by running the above command multiple times in different terminal windows or tabs.

Step 4: Testing with Postman

Now that your server and workers are running, you can test the setup using Postman or any other API testing tool. Send requests to the Express server, which will manage the queueing and processing of tasks using the worker services.

Project Structure

express-backend: Contains the Express server implementation.
worker: Contains the worker service that processes tasks from the Redis queue.

About

Implementing a design pattern which is leveraging message queues via redis mqs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published