ProductPromotion
Logo

Node.JS

made by https://0x3d.site

GitHub - weyoss/redis-smq: A simple high-performance Redis message queue for Node.js.
A simple high-performance Redis message queue for Node.js. - weyoss/redis-smq
Visit Site

GitHub - weyoss/redis-smq: A simple high-performance Redis message queue for Node.js.

GitHub - weyoss/redis-smq: A simple high-performance Redis message queue for Node.js.

[!IMPORTANT] Currently, RedisSMQ is going under heavy development. Pre-releases at any time may introduce new commits with breaking changes. The master branch always reflects the most recent changes. To view the latest release reference see RedisSMQ v7.2.3

RedisSMQ

RedisSMQ is a Node.js library for queuing messages (aka jobs) and processing them asynchronously with consumers. Backed by Redis, it allows scaling up your typical applications with ease of use.

Features

RedisSMQ Use Case: Multi-Queue Producers & Multi-Queue Consumers

RedisSMQ Multi-Queue Producers & Multi-Queue Consumers

What's new?

:rocket: RC's are now available for RedisSMQ v8! The v8 release will bring major improvements and new features. Some of them are:

  • Message queue codebase refactoring and optimizations.
  • Message storage and handling improvements.
  • Message status which allows to retrieve, at any time, the status of a message by its ID.
  • Pub/Sub Delivery Model and Consumer Groups.
  • Message handlers sandboxing and message processing performance improvement with Message Handler Worker Threads.
  • Cross-system event propagation based on EventBus.
  • Better error handling aiming at reporting fatal errors to the application whenever it is possible and without crashing the main process.
  • ESM Modules Support.

Current RedisSMQ v8 RC status:

  • RedisSMQ Common Library
  • RedisSMQ
  • RESTful API
  • Web UI (WIP)

If you wish to get the latest updates early feel free to try RedisSMQ v8 RC. Do not hesitate to report any bug or issue if encountered.

Otherwise, stay with RedisSMQ v7 if you are looking for a fully working release with an HTTP API and a Web UI.

Installation

npm i redis-smq@rc

Considerations:

  • Minimal Node.js version is >= 18 (RedisSMQ is tested under current active LTS and maintenance LTS Node.js releases).
  • Minimal Redis server version is 4.0.0.

Usage

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

Producers and consumers exchange data using one or multiple queues that may be created using the Queue Class.

A queue is responsible for holding messages which are produced by producers and are delivered to consumers.

Creating a queue

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

In the example above we are defining a LIFO queue with a POINT-2-POINT delivery model.

See Queues for more details.

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(', ')}`);
});

See Producing Messages for more details.

Consuming a message

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

See Consuming Messages for more details.

Documentation

See RedisSMQ Docs for more details.

Contributing

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

License

MIT

Articles
to learn more about the nodejs concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about NodeJS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory