Skip to content

weyoss/redis-smq

Repository files navigation

RedisSMQ

A High-Performance Redis Simple Message Queue for Node.js

Build Code Quality Latest Release Downloads

What's New

  • 05.09.2025: V9 is coming soon — a focused refinement of V8. It brings end-to-end message observability, a more robust and efficient message storage layer, and a new Web UI for managing queues.

  • 13.04.2025: V8 is here! Major architecture improvements, Pub/Sub delivery model, worker threads, enhanced TypeScript support, and more. See release notes.

Key Features

Use Cases

  • Managing background tasks, such as email sending or data processing.
  • Efficiently scheduling and retrying tasks.
  • Communication between multiple services in microservices architectures.
  • Handling real-time events in gaming, IoT, or analytics systems.

Installation

To get started with RedisSMQ, you can install core packages using npm:

npm i redis-smq@latest redis-smq-common@latest --save

Don't forget to install a Redis client. Choose either node-redis or ioredis:

npm install @redis/client --save
# or
npm install ioredis --save

Ecosystem

Package Description
redis-smq A high-performance, reliable, and scalable message queue for Node.js.
redis-smq-common Provides essential components and utilities shared across RedisSMQ packages.
redis-smq-rest-api A RESTful API for interacting with RedisSMQ, with OpenAPI v3 and Swagger UI.
redis-smq-web-server A web server for the RedisSMQ Web UI, handling static assets, routing, and proxying.
redis-smq-web-ui A Single Page Application (SPA) for monitoring and managing RedisSMQ.

Version compatibility

Always install matching versions of RedisSMQ packages. See Version Compatibility.

Configuration

Set up the RedisSMQ configuration during your application bootstrap:

'use strict';
const { Configuration } = require('redis-smq');
const { ERedisConfigClient } = require('redis-smq-common');

const config = {
  redis: {
    // Using ioredis as the Redis client
    client: ERedisConfigClient.IOREDIS,
    // Add any other ioredis options here
    options: {
      host: '127.0.0.1',
      port: 6379,
    },
  },
};

Configuration.getSetConfig(config);

Usage

Here's a basic example to create a queue, produce a message, and consume it:

// Creating a queue
const queue = new Queue();
queue.save('my_queue', EQueueType.LIFO_QUEUE, EQueueDeliveryModel.POINT_TO_POINT, (err) => {
    if (err) console.error(err);
});

// Producing a message
const msg = new ProducibleMessage();
msg.setQueue('my_queue').setBody('Hello Word!');
producer.produce(msg, (err, ids) => {
    if (err) console.error(err);
    else console.log(`Produced message IDs are: ${ids.join(', ')}`);
});

// Consuming a message
const consumer = new Consumer();
const messageHandler = (msg, cb) => {
    console.log(msg.body);
    cb(); // Acknowledging
};
consumer.consume('my_queue', messageHandler, (err) => {
    if (err) console.error(err);
});

Documentation

For more information, visit the RedisSMQ Docs.

Contributing

Interested in contributing to this project? Please check out our CONTRIBUTING.md.

License

RedisSMQ is released under the MIT License.

About

A simple high-performance Redis message queue for Node.js.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •