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 (Redis Simple Message Queue) is a lightweight and efficient message queue system built on top of Redis, designed to facilitate message brokering and task processing in distributed systems. It leverages Redis's fast in-memory data structure store capabilities to provide reliable and quick message queuing, enabling developers to implement different asynchronous processing patterns.
-
Simplicity: It focuses on being easy to set up and use, making it accessible for developers who need simple message queuing without the complexity of larger systems.
-
High Performance: By utilizing Redis, RedisSMQ offers high throughput and low latency, making it suitable for applications that require real-time processing.
-
Durability and Reliability: It includes mechanisms for ensuring message delivery and handling failures gracefully, which is critical in production environments.
-
Scalability: RedisSMQ is designed to scale horizontally, making it suitable for large-scale applications.
- Task Queuing: Managing background tasks, such as email sending or data processing.
- Job Scheduling: Efficiently scheduling and retrying tasks.
- Distributed Systems: Communication between multiple services in microservices architectures.
- Real-Time Processing: Handling real-time events in gaming, IoT, or analytics systems.
Overall, RedisSMQ is a reliable, scalable, and easy-to-use message queue system that is well-suited for a wide range of applications, from real-time data processing to microservices architecture.
🚀 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.
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.
How it works:
- Producer: An application sends a message to RedisSMQ, which stores the message in a Redis queue.
- Consumer: Another application or thread consumes the message from the Redis queue.
- Ack/Unack: The consumer sends an acknowledgement (ACK) or unacknowledgement (UNACK) to RedisSMQ, indicating whether the message was successfully processed.
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.
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.
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.
See RedisSMQ Docs for more details.
So you are interested in contributing to this project? Please see CONTRIBUTING.md.