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

Overview

RedisSMQ - Yet another simple Redis message queue

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

For more details about RedisSMQ design see https://medium.com/@weyoss/building-a-simple-message-queue-using-redis-server-and-node-js-964eda240a2a

Features

  • Persistent: No messages are lost in case of a consumer failure.
  • Atomic: A message is delivered only once to one consumer (in FIFO order) so you would never fall into a situation where a message could be processed more than once.
  • High-performance message processing: See Performance for more details.
  • Scalable: A queue can be consumed by many concurrent consumers, running on the same or on different hosts.
  • Message expiration: A message will expire and not be consumed if it has been in the queue for longer than the TTL (time-to-live).
  • Message consume timeout: The amount of time for a consumer to consume a message. If the timeout exceeds, message processing is cancelled and the message is re-queued to be consumed again.
  • Delaying and scheduling message delivery: From version 1.0.19 a persistent scheduler has been built into RedisSMQ message queue. The scheduler accepts delaying messages, repeated messages delivery, period between repeats and CRON expressions.
  • Highly optimized: No promises, no async/await, small memory footprint, no memory leaks. See callbacks vs promises vs async/await benchmarks.
  • Monitorable: Statistics (input/processing/acks/unacks messages rates, online consumers, queues, etc.) are provided in real-time.
  • Logging: Supports JSON log format for troubleshooting and analytics purposes.
  • Configurable: Many options and features can be configured.
  • Supports both redis & ioredis: Starting from v1.1.0 RedisSMQ can be configured to use either redis or ioredis to connect to Redis server.

Table of content

  1. What's new?
  2. Installation
  3. Configuration
  4. Usage
    1. Message Class
    2. Producer Class
    3. Consumer Class
  5. Performance
    1. Scenarios
    2. Environment
    3. Results
  6. Troubleshooting and monitoring
    1. Logs
    2. Monitoring
  7. Contributing
  8. License

What's new?

Starting from v2.0.0 TypeScript is now supported. Types definitions are include out of box. Also you can find an example about how to use RedisSMQ in a TypeScript project in the example folder.

Installation

npm install redis-smq --save

Considerations:

  • Minimal Node.js version support is 7.0.0 (with --harmony flag), 7.6.0 (without --harmony flag). The latest stable Node.js version is recommended.
  • Minimal Redis server version is 2.6.12.

Configuration

Before running a Producer or a Consumer instance, an object containing the configuration parameters can be supplied to the class constructor in order to configure the message queue.

A configuration object may look like:

'use strict';

const path = require('path');

module.exports = {
    namespace: 'my_project_name',
    redis: {
        driver: 'redis',
        options: {
            host: '127.0.0.1',
            port: 6379,
            connect_timeout: 3600000,
        },
    },
    /*
    // for old syntax bellow, the redis driver is used by default
    redis: {
        host: '127.0.0.1',
        port: 6379,
        connect_timeout: 3600000,
    },
    */
    log: {
        enabled: 0,
        options: {
            level: 'trace',
            /*
            streams: [
                {
                    path: path.normalize(`${__dirname}/../logs/redis-smq.log`)
                },
            ],
            */
        },
    },
    monitor: {
        enabled: true,
        host: '127.0.0.1',
        port: 3000,
    },
};

Parameters

  • namespace (String): Optional. The namespace for message queues. It can be composed only of letters (a-z), numbers (0-9) and (-_) characters. Namespace can be for example configured per project.

  • redis (Object): Optional. Redis client parameters. If used without redis.driver and redis.options, for backward compatibility, this parameter would be considered as holding redis driver options and therefor the redis driver would be used by default.

  • redis.driver (String): Optional. Redis driver name. Can be either redis or ioredis.

  • redis.options (Object): Optional. Redis driver options.

  • log (Object): Optional. Logging parameters.

  • log.enabled (Integer/Boolean): Optional. Enable/disable logging. By default logging is disabled.

  • log.options (Object): Optional. All valid Bunyan configuration options are accepted. Please look at the Bunyan Repository for more details.

  • monitor (Object): Optional. RedisSMQ monitor parameters.

  • monitor.enabled (Boolean/Integer): Optional. Enable/Disable the monitor. By default disabled.

  • monitor.host (String): Optional. IP address of the monitor server. By default 0.0.0.0.

  • monitor.port (Integer): Optional. Port of the monitor server. By default 7210.

Usage

RedisSMQ provides 3 classes: Message, Producer and Consumer in order to work with the message queue.

Message Class

Message class is the main component responsible for creating and handling messages. It encapsulates and provides all the required methods needed to construct and deal with messages.

const { Message } = require('redis-smq');

const message = new Message();

message
    .setBody({hello: 'world'})
    .setTTL(3600000)
    .setScheduledDelay(10)
    .setScheduledRepeat(6)
    .setScheduledPeriod(60)
    .setScheduledCron('* 30 * * * *');

let messageTTL = message.getTTL();

// same as 
messageTTL = message.getProperty(Message.PROPERTY_TTL);

See Message API Reference for more details.

Producer Class

Producer class is in turn responsible for producing messages.

Each producer instance has an associated message queue and provides produceMessage() method which handle the message and decides to either send it to the message queue scheduler or to immediately enqueue it for delivery.

// filename: ./example/test-queue-producer.js

'use strict';
const { Message, Producer } = require('redis-smq');

const message = new Message();

message
    .setBody({hello: 'world'})
    .setTTL(3600000)
    .setScheduledDelay(10);

const producer = new Producer('test_queue');
producer.produceMessage(message, (err) => {
   if (err) console.log(err);
   else console.log('Successfully produced')
});

See Producer API Reference for more details.

Consumer Class

The Consumer class is the base class for all consumers. All consumers extends this base class and implements consume() method which got called once a message is received.

Consumer classes are saved per files. Each consumer file represents a consumer class.

A consumer class may look like:

// filename: ./example/test-queue-consumer.js

'use strict';

const redisSMQ = require('redis-smq');

const Consumer = redisSMQ.Consumer;

class TestQueueConsumer extends Consumer {
    /**
     *
     * @param message
     * @param cb
     */
    consume(message, cb) {
        //  console.log('Got a message to consume:', message);
        //  
        //  throw new Error('TEST!');
        //  
        //  cb(new Error('TEST!'));
        //  
        //  const timeout = parseInt(Math.random() * 100);
        //  setTimeout(() => {
        //      cb();
        //  }, timeout);
        cb();
    }
}

TestQueueConsumer.queueName = 'test_queue';

const consumer = new TestQueueConsumer();
consumer.run();

To start consuming messages, a consumer needs first to be launched from CLI to connect to the Redis server and wait for messages:

$ node ./example/test-queue-consumer.js

Once a message is received and processed the consumer should acknowledge the message by invoking the callback function without arguments.

The message acknowledgment informs the message queue that the message has been successfully consumed.

If an error occurs, the message should be unacknowledged and the error should be reported to the message queue by calling the callback function. Failed messages are re-queued and delivered again unless message retry threshold is exceeded. Then the messages are moved to dead-letter queue (DLQ). Each message queue has a system generated corresponding queue called dead-letter queue where all failed to consume messages are moved to.

See Consumer API Reference for more details.

Performance

One key indicator about how RedisSMQ is fast and performant is Message throughput. Message throughput is the number of messages per second that the message queue can process.

Scenarios

We can measure the Producer throughput and the Consumer throughput. The benchmark is composed of:

  1. Measuring Producer throughput (without consumers running at the same time)
  2. Measuring Consumer throughput (without producers running at the same time)
  3. Measuring throughput of Producer and Consumer both running at the same time

In all scenarios messages are produced and consumed as fast as possible.

Environment

The benchmark was performed on a KVM virtual machine (4 CPU cores, 8GB RAM) hosted on a desktop computer (CPU AMD FX8350, RAM 32GB) running Debian 8.

No performance tuning was performed for the VM, neither for Redis server. Default parameters were used out of box.

The virtual machine was setup to run a single instance of Redis (Redis is single threaded, so more instances can boost performance).

All consumers, producers, monitor and redis server are launched from the same host.

Results

Scenario Producer rate (msg/sec) Consumer rate (msg/sec)
Run 1 producer instance 23K+ 0
Run 10 producer instances 96K+ 0
Run 1 consumer instance 0 13K+
Run 10 consumer instances 0 49K+
Run 1 producer instance and 1 consumer instance 22K+ 12K+
Run 10 producer instances and 10 consumer instances 45K+ 27K+
Run 10 producer instances and 20 consumer instances 32K+ 32K+

Troubleshooting and monitoring

Logs

This package is using JSON log format, thanks to Bunyan.

The structured data format of JSON allows analytics tools to take place but also helps to monitor and troubleshoot issues easier and faster.

By default all logs are disabled. Logging can affect performance (due to I/O operations). When enabled you can use bunyan utility to pretty format the output.

Unless configured otherwise, the standard output is the console which launched the consumer.

$ node consumer | ./node_modules/.bin/bunyan

Monitoring

The RedisSMQ Monitor is an interface which let you monitor and debug your RedisSMQ server from a web browser in real-time.

Starting from version v1.1.0, RedisSMQ Monitor has split up into a standalone project and was packaged under RedisSMQ Monitor

RedisSMQ includes the monitor as part of its package.

// filename: ./example/monitor.js
'use strict';

const config = require('./config');
const { monitor } = require('redis-smq');

monitor(config).listen(() => {
    console.log('It works!')
});

Contributing

So you are interested in contributing to this project? Please see CONTRIBUTING.md.

License

MIT

Comments
  • MaxListenersExceededWarning: Possible EventEmitter memory leak detected

    MaxListenersExceededWarning: Possible EventEmitter memory leak detected

    Hi, I was trying to produce multiple messages and encountered this warning

    (node:1055180) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 up listeners added to [Producer]. Use emitter.setMaxListeners() to increase limit
        at _addListener (node:events:601:17)
        at Producer.addListener (node:events:619:10)
        at Producer.once (node:events:663:8)
        at Producer.produce (node_modules/redis-smq/dist/src/lib/producer/producer.js:94:26)
    

    It's from the once(events.UP, proceed).

    enhancement 
    opened by hiendaovinh 15
  • worker监听消息需要添加消息类型判断 worker monitoring message needs to add message type judgment

    worker监听消息需要添加消息类型判断 worker monitoring message needs to add message type judgment

    消息通知 消息体

    • 我使用的是Egg框架,delay.worker可以收到到其他线程发送的消息,你应该加个消息判断
    • I am using the Egg framework, delay.worker can receive messages sent by other threads, you should add a message to judge
    enhancement 
    opened by xinlingqudongX 12
  • Any chance of updating Redis to v4

    Any chance of updating Redis to v4

    Hello

    The latest version of Redis allows for Promises and is a much nicer way of working, at the moment we use Handi-Redis to bypass this as using Redis 4 conflicts with this package's Redis 3.*.

    I will look forward to your reply

    Best Regards Chris

    question 
    opened by chris-elmstone 10
  • Consumer throttling

    Consumer throttling

    This project is very interesting and straight forward to use.

    One use-case I'd like is to throttle message consumption for the purpose of consuming 3rd party API calls. It would be good to have an configuration for the consumer which allows you to set the interval and quantity within that interval, much like this library: https://www.npmjs.com/package/p-throttle

    Is this something you would be interested in adding?

    question / feature request 
    opened by PhilHannent 8
  • Add delay between retry

    Add delay between retry

    I'm trying to figure out how to add delay between retry on error. Neither setScheduledPeriod or setScheduledDelay seems to do it. I want to retry a .job n number of times only on failure and there must be 10 minutes delay between retry. Is this possible to do?

    bug enhancement 
    opened by amitava82 8
  • Checking if a message handler exists

    Checking if a message handler exists

    Hi there My consumer may have many message handlers for different queues. By setting up new message handlers, there might be errors because the handlers already exist.

    So I want to check if a message handler already exists before adding a new one. Is it possible to expose getMessageHandler or there is a better approach?

    Plus, if I have multiple instances of the same app which use consumers, they actually won't know each other's messageHandler? In that case, is it possible to find out any consumer is consuming a particular queue (and ns)?

    enhancement question / feature request 
    opened by PhantomRay 7
  • Consuming messages from a priority queue

    Consuming messages from a priority queue

    Hi there

    const { Consumer, Message, Producer } = require('redis-smq');
    
    const consumer = new Consumer();
    
    const messageHandler = (msg, cb) => {
      const payload = msg.getBody();
      console.log('handler1: ', payload);
      cb(); // acknowledging the message
    };
    
    // the second parameter is for enabling priority queuing
    consumer.consume('queue1', false, messageHandler, (err, isRunning) => {
      if (err) console.error(err);
      // the message handler will be started only if the consumer is running
      else {
        console.log(
          `handler1 has been registered. Running status: ${isRunning}`,
        );
      } // isRunning === false
    });
    
    const anotherMessageHandler = (msg, cb) => {
      const payload = msg.getBody();
      console.log('handler2: ', payload);
      // ...
      cb();
    };
    
    consumer.consume(
      'queue2',
      false,
      anotherMessageHandler,
      (err, isRunning) => {
        if (err) console.error(err);
        // the message handler will be started only if the consumer is running
        else {
          console.log(
            `handler2 has been registered. Running status: ${isRunning}`,
          );
        }
      },
    );
    
    consumer.run();
    
    // -------------------------------------------------
    
    const message1 = new Message();
    message1
      .setBody({ hello: 'world1' })
      .setTTL(3600000) // in millis
      .setQueue('queue1');
    
    const message2 = new Message();
    message2
      .setBody({ hello: 'world2' })
      .setTTL(3600000) // in millis
      .setQueue('queue2');
    
    const producer = new Producer();
    producer.produce(message1, (err) => {
      if (err) console.log(err);
      else {
        const msgId = message1.getId(); // string
        console.log('Successfully produced. Message ID is ', msgId);
      }
    });
    
    
    producer.produce(message2, (err) => {
      if (err) console.log(err);
      else {
        const msgId = message2.getId(); // string
        console.log('Successfully produced. Message ID is ', msgId);
      }
    });
    

    For the code above, both queues are not priority queue. The output will be always:

    handler1 has been registered. Running status: false
    handler2 has been registered. Running status: false
    Successfully produced. Message ID is  8ce2fca4-5e41-49cb-9de6-cd3eedcbaad0
    Successfully produced. Message ID is  69b7f2e1-a532-4823-a4b4-88f1a42102e5
    handler1:  { hello: 'world1' }
    handler2:  { hello: 'world2' }
    

    If I change the the second one to priority queue consumer.consume('queue2', true, anotherMessageHandler,..., I run it for a few times, I always get this result:

    handler1 has been registered. Running status: false
    handler2 has been registered. Running status: false
    Successfully produced. Message ID is  736395df-bd62-4762-8176-5fb96d857cbc
    Successfully produced. Message ID is  ce50472d-2926-4f25-9d7a-bd19ed6b5e52
    handler1:  { hello: 'world1' }
    

    If I set priority back to false for the second queue, I got this output:

    handler1 has been registered. Running status: false
    handler2 has been registered. Running status: false
    Successfully produced. Message ID is  1f14a3f4-71ee-4eec-8d4b-938b0883c4a9
    Successfully produced. Message ID is  c8f6e2c7-e497-4902-88d5-78f38c7d2ab3
    handler1:  { hello: 'world1' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    handler2:  { hello: 'world2' }
    

    My question is, when I use consumer.consume('queue2', true, anotherMessageHandler,..., why couldn't I consume the messages from 2nd queue?

    question 
    opened by PhantomRay 7
  • "Can not switch state while another state transition is in progress." - when consumer.shutdown() is called twice

    Hi there.

    While consumer is running, when I call consumer.shutdown() twice, the second call throws Can not switch state while another state transition is in progress. error.

    Actual:

         consumer.shutdown();
         try {
            consumer.shutdown();
          } catch (err) {
           // error caught as "Can not switch state while another state transition is in progress."
            console.error(err.message);
          }
    

    Actual:

        consumer.shutdown();
        consumer.shutdown((err)=>{
            // unable to catch "Can not switch state while another state transition is in progress." error
        });
    

    IMO, any error should be thrown to the callback in shutdown(cb).

    Expect:

        consumer.shutdown();
        consumer.shutdown((err)=>{
            // catch error here
        });
    
    help wanted 
    opened by PhantomRay 7
  • MultiQueueProducer doesn't seem to work [6.0.0-rc.4]

    MultiQueueProducer doesn't seem to work [6.0.0-rc.4]

    Hi there, with Producer, I'm able to produce/consume the message, but with MultiQueueProducer, it seems it doesn't work.

    This works

    const { Consumer, Producer, Message } = require('redis-smq');
    const queue = 'S-12345'
    
    const message = new Message();
    message
        .setBody({ hello: 'world', ts: new Date() })
        .setTTL(3600000);
    
    const producer = new Producer(queue);
    
    setInterval(() => {
        producer.produce(message, (err) => {
            if (err) console.log(err);
            else console.log('Successfully produced')
        });
    }, 1000);
    
    class TestQueueConsumer extends Consumer {
        consume(message, cb) {
            console.log('Got a message to consume:', message.body);
            cb();
        }
    }
    
    const consumer = new TestQueueConsumer(queue);
    consumer.run();
    console.log('consumer running')
    

    This doesn't work

    const { Consumer, MultiQueueProducer, Message } = require('redis-smq');
    
    const queue = 'S-12345'
    
    const message = new Message();
    message
        .setBody({ hello: 'world', ts: new Date() })
        .setTTL(3600000);
    
    const producer = new MultiQueueProducer();
    
    setInterval(() => {
        producer.produce(queue, message, (err) => {
            if (err) console.log(err);
            else console.log('Successfully produced')
        });
    }, 1000);
    
    class TestQueueConsumer extends Consumer {
        consume(message, cb) {
            console.log('Got a message to consume:', message.body);
            cb();
        }
    }
    
    const consumer = new TestQueueConsumer(queue);
    consumer.run();
    console.log('consumer running')
    

    Anything wrong? Thanks in advance.

    bug 
    opened by PhantomRay 6
  • Produce messages for multiple queues

    Produce messages for multiple queues

    Hi there, In my use case, I have to send the same message to a large number of queues. By using Producer class, I will have to create multiple instances of producers for multiple queues.

    What's the more efficient way to do this? e.g. can we have something like producer.produce(queue, message, cb)?

    Thanks.

    question / feature request 
    opened by PhantomRay 6
  • Many redis connections

    Many redis connections

    If we are talking about high performance, then a large number of connections create locks at the redis level, and in our case, these are 15 connections per 1 Producer and 1 consumer: Consumer - 11 connections Producer - 4 connections

    I researched the code and saw no reason to use that many connections. For a producer, 1 connection is enough. For the consumer, 3 connections are enough, one for the main process and two for the forks.

    question / feature request 
    opened by intech 6
  • Support ioredis cluster configuration

    Support ioredis cluster configuration

    Actually all ioredis configuration parameters are supported.

    But there is no way to provide and use a cluster configuration.

    See https://github.com/luin/ioredis#cluster

    enhancement feature request 
    opened by weyoss 0
  • Feature request: Queue size limiting

    Feature request: Queue size limiting

    hi there, Is it possible to limit the size of the queue. For example, I'm only interested in last 10 messages of a queue. The queue will hold 10 messages max and old messages will be dumped.

    This is common for some queue systems or databases.

    Not super important but nice to have.

    feature request 
    opened by PhantomRay 1
  • redis-smq has better performance than bull, what to choose?

    redis-smq has better performance than bull, what to choose?

    @weyoss Thanks for nicely crafted library.

    I have done some performance benchmark to compare redis-smq with bull on my Dell XPS. Machine 16GB RAM, Hexa Core

    No doubt, redis-smq is clear winner because of it's simplicity and focused approach towards message queuing.

    Following is the messages produced and consumed rate | Scenarios | redis-smq produce rate and consumed rate | bull produce rate and consumed rate | |--- |--- |--- | | 1 producer and 1 consumer | 16.5k/sec and 9k/sec | 9.5k/sec and 7k/sec | | 1 producer and 2 consumer | 15k/sec and 13.5k/sec | 5.0k/sec and 5.0k/sec | | 2 producer and 2 consumer | 23.3k/sec and 13.2k/sec | 13.3k/sec and 10.6k/sec | | 4 producer and 4 consumer | 30k/sec and 17.8k/sec | 13.4k/sec and 10.4k/sec | | 6 producer and 3 consumer | 40k/sec and 16.1k/sec | 17.5k/sec and 12.2k/sec |

    It is clearly visible that bull is almost saturated in terms of producer and consumer rate. There can be multiple reasons of less performance in bull like promises or multiple checks & conditions to provide other features like rate limiting etc.

    Though, I am not able to convince myself which library to use for my next project, because redis-smq simplicity and performance is far ahead of bull, which is the purpose of this lib, but bull has lot of features, which can be useful when things are in production.

    I am thinking to move from RabbitMQ to Redis, because I don't need complex routing like RabbitMQ. I have also seen heavy usage for simple queuing task in RabbitMQ, where RabbitMQ was taking approx 2GB for holding 1 million messages and total messages size was around 100MB. So ideally in Redis, it would be 100MB only. I understand RabbitMQ do lot of things out of the box, but I think Redis can work very well in simple queuing cases.

    Any suggestion would be appreciated by anyone to take this decision. I am also interested to listen more from actual user of this library who have used it in production with heavy load.

    Thanks.

    question / feature request 
    opened by AmreeshTyagi 1
Releases(v7.1.3)
  • v7.1.3(Oct 26, 2022)

    • test(FanOutExchangeManager): test binding queues of different types (d2e287c)
    • fix(FanOutExchangeManager): forbid binding queues of different types (0df6bdc)
    Source code(tar.gz)
    Source code(zip)
  • v7.1.2(Oct 22, 2022)

    • fix(FanOutExchangeManager): fix unbindQueue() transaction handling (dec63de)
    • fix(FanOutExchangeManager): fix bindQueue() transaction handling (afbdde6)
    • docs(queues): fix typos (08f29c0)
    • docs(queues): add queues.md reference, clean up (3219eb8)
    • docs: improve documentation, add missing links (c740e11)
    Source code(tar.gz)
    Source code(zip)
  • v7.1.1(Oct 11, 2022)

  • v7.1.0(Oct 6, 2022)

    • docs: update README.md (8734e49)
    • build: update npm dependencies (4225c50)
    • test(FanOutExchangeManager): increase code coverage (df4c693)
    • refactor(FanOutExchangeManager): improve unbindQueue() logic (c1440a5)
    • docs: update docs (508430f)
    • fix: fix typing error (05c1575)
    • test: increase code coverage (c4ba4f3)
    • refactor: rename saveExchange() to createExchange() (995ca03)
    • refactor: improve TQueueSettings typing (413f4d3)
    • refactor: bump up redis keys version (3389216)
    • refactor: add EQueueSettingType, remove KEY_QUEUE_SETTINGS_* keys (600199c)
    • refactor(queue-manager): update queue.create() reply payload (f3a12d1)
    • feat(FanOutExchangeManager): add saveExchange(), deleteExchange() (1ce22cc)
    • refactor(redis-keys): clean up validateRedisKey() (e921540)
    • fix(FanOutExchange): fix bindingParams validation (327d045)
    • test(exchange): increase code coverage (f5f5d95)
    • feat(exchange): allow retrieving fanout exchange list (8a96b17)
    • refactor(exchange): improve exchange tag naming (a089738)
    • refactor(message): improve message.exchange typing (9ce281a)
    • refactor(queue-manager): clean up (ce5ab8e)
    • docs(message): update MessageMetadata references (5041a85)
    • test(message): update MessageMetadata references (9888918)
    • refactor(message): rename MessageMetadata to MessageState, clean up (2de18b4)
    • docs(exchange): improve documentation (718a80a)
    • docs(producer): update docs (1965a75)
    • docs(exchange): fix typos (93b4c8e)
    • test(exchange): test exchanges with unmatched queues (d836eab)
    • fix(exchange): return an error for exchanges with unmatched queues (e89ce06)
    • docs(message): add missing method references (c723ec2)
    • docs(exchange): update docs (1dc02a4)
    • refactor(exchange): rename FanOutExchangeManager methods (f981241)
    • docs(exchange): add FanOutExchangeManager reference (9cecc89)
    • test(exchange): update fanout-exchange tests (be75519)
    • feat(exchange): add FanOutExchangeManager (f8168a4)
    • refactor(exchange): rename files (fd9d906)
    • build: update workflow names (7b1b545)
    • docs(readme): display the status of codeql.yml workflow (94eb97a)
    • perf(redis-keys): fix inefficient regex complexity (dcb4f1f)
    • build: set up code scanning (be0dd02)
    • docs(exchange): update message-exchanges.md (49436af)
    • test(exchange): fix test errors (f3aa786)
    • docs(exchange): fix typos (a62a732)
    • fix(redis-keys): enforce a redis key to start with a letter (a-z) (ecb7493)
    • docs(exchange): update docs (wip) (6d3eaee)
    • fix(exchange): export DirectExchange/TopicExchange/FanOutExchange classes (c070f3c)
    • test(exchange): increase code coverage (063582c)
    • refactor(exchange): add and use InvalidExchangeDataError (482e093)
    • docs(readme): add reference to current release documentation (747e4e3)
    • docs(producer): update producer.produce() parameters (938976e)
    • fix: fix various typings issues (9c51445)
    • chore: update examples (3628813)
    • refactor: update tests (1456c5a)
    • test(exchange): test fanout and topic exchanges (54c081b)
    • feat(queue-manager): allow to bind/unbind a queue to an exchange (cd91109)
    • refactor(exchange): remove code redundancies and clean up (2dc2cba)
    • chore: bump up redis-smq-common to v1.0.4 (5181ad7)
    • feat(exchange): implement missing methods of TopicExchange class (e2119b5)
    • feat(redis-keys): allow redis keys to include a dot (92b8b05)
    • perf(queue-manager): use sscan instead of smembers (8f491f4)
    • feat(exchange): implement direct, fanout, and topic exchanges (1617e9b)
    • chore: bump up redis-smq-common to 1.0.3 (d7f4aba)
    • chore: clean up (ee88201)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.7(Aug 10, 2022)

  • v7.0.6(Aug 8, 2022)

    • Improve consumer/producer shutdown handling (36278ce)
    • Update docs (51dfd16)
    • Update examples (208934b)
    • Fix tests (573e340)
    • Add and use ProducerNotRunningError error class (e89facd)
    • Fix a potential MaxListenersExceededWarning exception throwing (011a21b)
    • Make producers to be run manually before producing messages (c989449)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.5(Jul 20, 2022)

  • v7.0.4(Jul 14, 2022)

  • v7.0.3(Jul 13, 2022)

  • v7.0.2(Jul 13, 2022)

    • Bump up redis-smq-common to v1.0.1 (e3fbb10)
    • Bump up typescript to v4.7.4 (0f69254)
    • Fix npm vulnerability warnings (9925be0)
    • Clean up examples (72ea0fb)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.1(Jun 18, 2022)

  • v7.0.0(Jun 18, 2022)

    • Fix typing issue (cd8bf6a)
    • Bump up redis-smq-common to v1.0.0 (02c353d)
    • Update callback vs promise vs async/await benchmarks (6fca49c)
    • Update README.md (7fbdcbf)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.0-rc.8(Jun 8, 2022)

  • v7.0.0-rc.7(Jun 7, 2022)

    • Update redis keys prefix (a6ca852)
    • Use codecov instead of coveralls (d8b5f83)
    • Improve consuming-messages/test00013 (5cd823c)
    • Improve consuming-messages/test00010 (a9a4f47)
    • Test WatchdogWorker (73fbe9a)
    • Clean up (aa9a51a)
    • Improve unacknowleged messages handling, refactor (005c6a0)
    • Fix outdated javascript examples (e31f89c)
    • Keep a clean directory structure (642739f)
    • Update README.md (5c011e3)
    • Clean up tests (10ebb77)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.0-rc.6(Jun 2, 2022)

  • v7.0.0-rc.5(Jun 2, 2022)

  • v7.0.0-rc.4(May 30, 2022)

    • Update README.md (fef27c1)
    • Support node-redis v4 (c7a91b1)
    • Drop support for node.js v12 (0b5a4e9)
    • Fix outdated documentation (d3bf31b)
    • Fix broken link (fd48c86)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.0-rc.3(May 26, 2022)

    • Update migration/configuration/message/message-manager references (6d53877)
    • Update docs (df2eddb)
    • Bump up redis-smq-common to v1.0.0-rc.3, refactor (0508c75)
    • Bump up redis-smq-common to v1.0.0-rc.2 (f38d757)
    • Remove singletons, use instance based configuration (65f28ec)
    • Fix 'fsevents not accessible from jest-haste-map' error (1cbc786)
    • Use shared components from redis-smq-common (2abfb98)
    • Reorganize codebase folders (cdf25fa)
    • Clean up redis-keys.ts (c6b8af8)
    • Add PluginRegistrationNotAllowedError error, clean up (aa003a1)
    • Update tests (0950706)
    • Implement a plugging system for using the web-ui as an extension (e2b0cca)
    • Fix tests (ca01d66)
    • Reorganize codebase files (2cef191)
    • Remove the web ui from codebase, clean up (ffe03c9)
    • Update http-api.md (4023dc5)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.0-rc.2(May 18, 2022)

    • Fix typo (8002616)
    • Update docs (d40b1c2)
    • Update misc scripts (bde5171)
    • Clean up WebsocketRateStreamWorker, use incremental timestamp (918fac0)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.0-rc.1(May 15, 2022)

    • Update docs (41ee4bf)
    • Fix consuming-messages/test00015 test (8b3072a)
    • Clean up and simplify the consumer.consume() callback argument (bd98b65)
    • Update docs (9ede0f6)
    • Update tests (b1772aa)
    • Refactor configuration object (2ebe1ba)
    • Make QueueManager constructor private (c55cdad)
    • Update redisKeys version (add3e8d)
    • Update scheduling-messages.md (4b2bb2d)
    • Update multiplexing.md (f36f712)
    Source code(tar.gz)
    Source code(zip)
  • v7.0.0-rc.0(May 13, 2022)

    • Update LICENSE (2ef31db)
    • Update multiplexing.md (62c575e)
    • Add v7 migration guide (48e325e)
    • Add error codes for message publishing/scheduling failures (e89308d)
    • Update examples (564ffe6)
    • Update docs (e8d80c2)
    • Bump up redis-smq-monitor to v7.0.0-rc.0 (059e0fd)
    • Update docs (5810361)
    • Fix http-api/test00001 test (a2f257c)
    • Update docs (117955a)
    • Update tests (ba83f0b)
    • Improve QueueManager methods naming (b1c5237)
    • Clean up (f57f237)
    • Fix pending messages related data in websocket streams (bbd99cb)
    • Clean up (5ae08f8)
    • Update examples (e3990a9)
    • Update tests (86d58e4)
    • Unify pending messages API for both LIFO and Priority messages (ffdbfd1)
    • Fix tests (f00ea26)
    • Fix queue creation, handle properly queue settings (ec00907)
    • Clean up Queue class (afce21f)
    • Update tests (3bc9fd4)
    • Clean up QueueManager (852633d)
    • Validate the message queue before scheduling a message (9c70c0c)
    • Refactor MessageManager API, clean up (0df67f3)
    • Fix various tests errors due to incompatible APIs (bea78a6)
    • Refactor Producer/Consumer/QueueManager APIs (3f0574a)
    • Refactor consumer class, update consumer.consume() signature (618172c)
    • Expect the number messages to be at greater than 6 (02ea402)
    • Improve consuming-messages/test00031 (3605512)
    • Clean up (3660ba3)
    • Bump up redis-smq-monitor to v6.5.7 (05d004a)
    • Fix consuming-messages/test00014 (8a1b7b9)
    • Merge branch 'lock-manager' (c1edcb2)
    • Throw an error when a lock could not be acquired or extended (5ff1fca)
    • Refactor LockManager to allow auto extending locks (efbbe35)
    Source code(tar.gz)
    Source code(zip)
  • v6.4.2(Apr 23, 2022)

    • Test expired locks (367660e)
    • Do not throw an exception and try to acquire again an expired lock (b7f7d36)
    • Bump up redis-smq-monitor to v6.5.6 (c31cd2e)
    • Fix NPM security vulnerabilities (3900ddf)
    • Clean up monitor-server services (954d856)
    Source code(tar.gz)
    Source code(zip)
  • v6.4.1(Mar 22, 2022)

  • v6.4.0(Mar 22, 2022)

    • Update Web UI docs (ed63186)
    • Bump up redis-smq-monitor to v6.5.5 (3179f85)
    • Test monitor.basePath configuration (00c680d)
    • Support basePath when running web ui from behind a reverse proxy (ea17ffe)
    Source code(tar.gz)
    Source code(zip)
  • v6.3.1(Mar 15, 2022)

  • v6.3.0(Mar 15, 2022)

    6.3.0 (2022-03-15)

    • Update docs (3ad938a)
    • Use colons instead of dots for joining Redis key segments (75dbcb6)
    • Continue testing consumer message multiplexing (17c9659)
    • Improve multiplexing delay when dequeuing messages (a635c8a)
    • Remove deprecated consumer.cancel(queue,priority,cb), add new tests (4a2d458)
    • Fix test errors, clean up (09feb9c)
    • Prefer method definition over arrow function property (5d7e664)
    • Implement MultiplexedMessageHandlerRunner (6980cbf)
    • Refactor MessageHandler to allow more modular structures (b079244)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.6(Mar 4, 2022)

  • v6.2.5(Mar 3, 2022)

    • Update Consumer API docs (8580f4a)
    • Do not consume messages with and without priority from the same queue (84130bf)
    • Use default parameters when creating a Ticker instance (db9feb0)
    • Update consumer queue list upon shutting down a message handler (14519e2)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.4(Feb 23, 2022)

  • v6.2.3(Feb 23, 2022)

    • Bump up redis-smq-monitor to v6.5.3 (4e845d0)
    • Remove gracefully a message handler (a4402b7)
    • Add MessageHandlerAlreadyExistsError custom error (65882ed)
    Source code(tar.gz)
    Source code(zip)
Owner
null
BullMQ - Premium Message Queue for NodeJS based on Redis

The fastest, most reliable, Redis-based distributed queue for Node. Carefully written for rock solid stability and atomicity. Read the documentation F

Taskforce.sh Inc. 3.1k Dec 30, 2022
A simple, fast, robust job/task queue for Node.js, backed by Redis.

A simple, fast, robust job/task queue for Node.js, backed by Redis. Simple: ~1000 LOC, and minimal dependencies. Fast: maximizes throughput by minimiz

Bee Queue 3.1k Jan 5, 2023
Kue is a priority job queue backed by redis, built for node.js.

Kue Kue is no longer maintained Please see e.g. Bull as an alternative. Thank you! Kue is a priority job queue backed by redis, built for node.js. PRO

Automattic 9.4k Dec 20, 2022
A fast, robust and extensible distributed task/job queue for Node.js, powered by Redis.

Conveyor MQ A fast, robust and extensible distributed task/job queue for Node.js, powered by Redis. Introduction Conveyor MQ is a general purpose, dis

Conveyor MQ 45 Dec 15, 2022
Redis-backed task queue engine with advanced task control and eventual consistency

idoit Redis-backed task queue engine with advanced task control and eventual consistency. Task grouping, chaining, iterators for huge ranges. Postpone

Nodeca 65 Dec 15, 2022
A simple Node.js APIBAN client for downloading banned IPs and inserting them into a redis set

apiban-redis A simple Node.js APIBAN client for downloading banned IPs and inserting them into a redis set. Installation This utility can be run as a

jambonz 4 Apr 5, 2022
A general-purpose message and event queuing library for MongoDB

MongoMQ2 MongoMQ2 is a light-weight Node.js library that turns MongoDB collections into general-purpose message queues or event logs, without addition

Morris Brodersen 11 Dec 28, 2022
Cache is easy to use data caching Node.js package. It supports Memcached, Redis, and In-Memory caching engines.

Cache Cache NPM implements wrapper over multiple caching engines - Memcached, Redis and In-memory (use with single threaded process in development mod

PLG Works 49 Oct 24, 2022
Premium Queue package for handling distributed jobs and messages in NodeJS.

The fastest, most reliable, Redis-based queue for Node. Carefully written for rock solid stability and atomicity. Sponsors · Features · UIs · Install

null 13.5k Dec 31, 2022
Better Queue for NodeJS

Better Queue - Powerful flow control Super simple to use Better Queue is designed to be simple to set up but still let you do complex things. Persiste

Diamond 415 Dec 17, 2022
Yet another concurrent priority task queue, yay!

YQueue Yet another concurrent priority task queue, yay! Install npm install yqueue Features Concurrency control Prioritized tasks Error handling for b

null 6 Apr 4, 2022
Opinionated, type-safe, zero-dependency max/min priority queue for JavaScript and TypeScript projects.

qewe qewe is an opinionated, type-safe, zero-dependency max/min priority queue for JavaScript and TypeScript projects. Installation Add qewe to your p

Jamie McElwain 2 Jan 10, 2022
A client-friendly run queue

client-run-queue This package provides a RunQueue implementation for scheduling and managing async or time-consuming functions such that client-side i

Passfolio 6 Nov 22, 2022
A document based messaging queue for Mongo, DocumentDB, and others

DocMQ Messaging Queue for any document-friendly architectures (DocumentDB, Mongo, Postgres + JSONB, etc). Why Choose This DocMQ is a good choice if yo

Jakob Heuser 10 Dec 7, 2022
A client-friendly run queue

client-run-queue This package provides a RunQueue implementation for scheduling and managing async or time-consuming functions such that client-side i

Passfolio 4 Jul 5, 2022
Nodejs Background jobs using redis.

node-resque: The best background jobs in node. Distributed delayed jobs in nodejs. Resque is a background job system backed by Redis (version 2.6.0 an

Actionhero 1.2k Jan 3, 2023
egg.js(jwt) + mysql(sequelize) + redis + docker + docker-compose + nginx + vue + element-ui 全栈获取省市区数据(统计局数据)【工具】项目,实现在docker环境中一键部署

Egg-spider Preview 线上预览地址 (https://ronaldoxzb.com/) admin admin Project description [后端]egg.js(jwt) + mysql(sequelize) + redis + docker + docker-compo

null 11 Sep 29, 2022
Serverless URL Shortener made with Next.js + Redis.

linki: a place for your links linki is a url shortener made with next.js and redis! built with simplicity in mind, it's all in one page. deploy your o

Jack Reiker 12 Sep 15, 2022
Serve read-only Redis data over a HTTP API with auth

Redis data exposer This was created for Cliptok and not intended for use outside of it. Use at your own peril. This application will serve an API that

Erisa A 10 May 28, 2022