redis-smq 8.0.0-rc.14 → 8.0.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +21 -18
- package/dist/index.cjs +1532 -828
- package/dist/index.d.cts +206 -72
- package/dist/index.d.ts +206 -72
- package/dist/index.js +1559 -853
- package/dist/lua/create-queue.lua +6 -3
- package/dist/lua/delete-consumer-group.lua +34 -0
- package/dist/lua/delete-message.lua +3 -3
- package/dist/lua/publish-message.lua +9 -9
- package/dist/lua/publish-scheduled-message.lua +3 -3
- package/dist/lua/requeue-message.lua +9 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [8.0.0-rc.15](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.14...v8.0.0-rc.15) (2024-01-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add Pub/Sub delivery model, refactor and clean up ([47affa1](https://github.com/weyoss/redis-smq/commit/47affa172eb2fc6943f660bea3feab3af1bc28ec))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
* add a notification about the latest release, clean up ([904f196](https://github.com/weyoss/redis-smq/commit/904f196f1854059625b08af05fe5ceb1466d4a9f))
|
|
14
|
+
* add Pub/Sub delivery model, refactor and clean up ([32db9dd](https://github.com/weyoss/redis-smq/commit/32db9dd2772bc16568e03e6e216a7d0fd0a599a7))
|
|
15
|
+
* clean up ([c7d13a6](https://github.com/weyoss/redis-smq/commit/c7d13a639a1ed9f134ba3deb99d1e2a23223935a))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Misc
|
|
19
|
+
|
|
20
|
+
* bump up redis-smq-common to v3.0.0-rc.8 ([d411849](https://github.com/weyoss/redis-smq/commit/d4118496263479036085ee09ceb5785ee497bb59))
|
|
21
|
+
* bump up redis-smq-common to v3.0.0-rc9 ([d372e9d](https://github.com/weyoss/redis-smq/commit/d372e9d98593934e9e9fb63efcd56cbad99202af))
|
|
22
|
+
|
|
3
23
|
## [8.0.0-rc.14](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.13...v8.0.0-rc.14) (2024-01-03)
|
|
4
24
|
|
|
5
25
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
> [!IMPORTANT]
|
|
2
|
+
> Currently, RedisSMQ is going under heavy development. Pre-releases at any time may introduce new commits with breaking changes.
|
|
3
|
+
> The master branch always reflects the most recent changes. To view the latest release reference see [RedisSMQ v7.2.3](https://github.com/weyoss/redis-smq/tree/v7.2.3)
|
|
4
|
+
|
|
1
5
|
<div align="center" style="text-align: center">
|
|
2
6
|
<p><a href="https://github.com/weyoss/redis-smq"><img alt="RedisSMQ" src="./logo.png?v=202312182134" /></a></p>
|
|
3
|
-
<p
|
|
7
|
+
<p>A simple high-performance Redis message queue for Node.js.</p>
|
|
4
8
|
</div>
|
|
5
9
|
|
|
6
10
|
# RedisSMQ
|
|
@@ -13,28 +17,27 @@
|
|
|
13
17
|
<a href="https://npmjs.org/package/redis-smq" rel="nofollow"><img src="https://img.shields.io/npm/dm/redis-smq.svg" alt="NPM downloads" /></a>
|
|
14
18
|
</p>
|
|
15
19
|
|
|
16
|
-
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
|
|
20
|
+
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.
|
|
17
21
|
|
|
18
22
|
## Features
|
|
19
23
|
|
|
20
24
|
* [High-performance message processing](docs/performance.md).
|
|
21
|
-
* Flexible Producer/Consumer model which offers [Multi-Queue Producers](docs/producing-messages.md) & [Multi-Queue Consumers](docs/consuming-messages.md)
|
|
22
|
-
* In case of failures, while delivering or processing a message, RedisSMQ can guaranty that the message is not lost and that it is redelivered [at-least-once](docs/api/classes/ProducibleMessage.md#setretrythreshold). When configured to do so, RedisSMQ can also ensure that the message is delivered [at-most-once](docs/api/classes/ProducibleMessage.md#setretrythreshold).
|
|
25
|
+
* Flexible Producer/Consumer model which offers [Multi-Queue Producers](docs/producing-messages.md) & [Multi-Queue Consumers](docs/consuming-messages.md).
|
|
23
26
|
* RedisSMQ offers different exchange types: [Direct Exchange](docs/message-exchanges.md#direct-exchange), [Topic Exchange](docs/message-exchanges.md#topic-exchange), and [FanOut Exchange](docs/message-exchanges.md#fanout-exchange) for publishing a message to one or multiple queues.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* [
|
|
27
|
-
*
|
|
28
|
-
* [
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* RedisSMQ
|
|
27
|
+
* Supports [Point-2-Point](docs/queue-delivery-models.md#point-2-point-delivery-model) and [Pub/Sub](docs/queue-delivery-models.md#pubsub-delivery-model) [delivery models](docs/queue-delivery-models.md).
|
|
28
|
+
* Both [delivery models](docs/queue-delivery-models.md) are reliable. For cases of failure, while delivering/consuming messages, [at-least-once](docs/api/classes/ProducibleMessage.md#setretrythreshold) and [at-most-once](docs/api/classes/ProducibleMessage.md#setretrythreshold) modes may be configured.
|
|
29
|
+
* [3 queuing strategies](docs/queues.md): [FIFO queues](docs/queues.md#fifo-first-in-first-out-queues), [LIFO queues](docs/queues.md#lifo-last-in-first-out-queues), and [Priority Queues](docs/queues.md#priority-queues).
|
|
30
|
+
* Messages can be [set to expire](docs/api/classes/ProducibleMessage.md#setttl) when not delivered within a given amount of time or to have a [consumption timeout](docs/api/classes/ProducibleMessage.md#setconsumetimeout) while being in process.
|
|
31
|
+
* Queues may be [rate Limited](docs/queue-rate-limiting.md) to control the rate at which the messages are consumed.
|
|
32
|
+
* Has a builtin [scheduler](docs/scheduling-messages.md) allowing messages [to be delayed](docs/api/classes/ProducibleMessage.md#setscheduleddelay), [to be delivered for N times](docs/api/classes/ProducibleMessage.md#setscheduledrepeat) with an optional [period between deliveries](docs/api/classes/ProducibleMessage.md#setscheduledrepeatperiod), or simply [to be scheduled using CRON expressions](docs/api/classes/ProducibleMessage.md#setscheduledcron).
|
|
33
|
+
* Provides [an HTTP API](https://github.com/weyoss/redis-smq-monitor) to interact with the message queue for external services.
|
|
34
|
+
* RedisSMQ can be managed also from your [web browser](https://github.com/weyoss/redis-smq-monitor-client).
|
|
35
|
+
* Either [node-redis](https://github.com/redis/node-redis) or [ioredis](https://github.com/luin/ioredis) can be used as a Redis client.
|
|
36
|
+
* [Highly optimized](https://lgtm.com/projects/g/weyoss/redis-smq/context:javascript), implemented using pure callbacks, with small memory footprint and no memory leaks. See [Callback vs Promise vs Async/Await benchmarks](https://gist.github.com/weyoss/24f9ecbda175d943a48cb7ec38bde821).
|
|
32
37
|
* [Both ESM & CJS modules are supported](docs/esm-cjs-modules.md).
|
|
33
38
|
|
|
34
39
|
## RedisSMQ Use Case: Multi-Queue Producers & Multi-Queue Consumers
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
|
|
38
41
|

|
|
39
42
|
|
|
40
43
|
## What's new?
|
|
@@ -43,8 +46,6 @@ RedisSMQ is a Node.js library for queuing messages (aka jobs) and processing the
|
|
|
43
46
|
|
|
44
47
|
## Installation
|
|
45
48
|
|
|
46
|
-
> Currently, RedisSMQ is going under heavy development. Pre-releases at any time may introduce new commits with breaking changes. To view the latest release reference see [RedisSMQ v7.2.3](https://github.com/weyoss/redis-smq/tree/v7.2.3)
|
|
47
|
-
|
|
48
49
|
```shell
|
|
49
50
|
npm i redis-smq@rc
|
|
50
51
|
```
|
|
@@ -65,14 +66,16 @@ A queue is responsible for holding messages which are produced by producers and
|
|
|
65
66
|
### Creating a queue
|
|
66
67
|
|
|
67
68
|
```javascript
|
|
68
|
-
const { Queue, EQueueType } = require('redis-smq');
|
|
69
|
+
const { Queue, EQueueType, EQueueDeliveryModel } = require('redis-smq');
|
|
69
70
|
|
|
70
71
|
const queue = new Queue();
|
|
71
72
|
|
|
72
73
|
// Creating a LIFO queue
|
|
73
|
-
queue.save('my_queue', EQueueType.LIFO_QUEUE, (err) => console.log(err));
|
|
74
|
+
queue.save('my_queue', EQueueType.LIFO_QUEUE, EQueueDeliveryModel.POINT_TO_POINT, (err) => console.log(err));
|
|
74
75
|
```
|
|
75
76
|
|
|
77
|
+
In the example above we are defining a [LIFO queue](docs/queues.md#lifo-last-in-first-out-queues) with a [POINT-2-POINT delivery model](docs/queue-delivery-models.md#point-2-point-delivery-model).
|
|
78
|
+
|
|
76
79
|
### Producing a message
|
|
77
80
|
|
|
78
81
|
```javascript
|