redis-smq 8.0.0-rc.1 → 8.0.0-rc.11
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 +203 -2
- package/README.md +20 -23
- package/dist/index.cjs +1040 -937
- package/dist/index.d.cts +284 -274
- package/dist/index.d.ts +284 -274
- package/dist/index.js +988 -878
- package/dist/lua/publish-scheduled-message.lua +63 -36
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,208 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [8.0.0-rc.11](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.10...v8.0.0-rc.11) (2023-12-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Documentation
|
|
7
|
+
|
|
8
|
+
* **IConsumableMessage:** clean up ([5b5ce3a](https://github.com/weyoss/redis-smq/commit/5b5ce3aedd3e378cc74a2715da2ae1e98f41124f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Codebase Refactoring
|
|
12
|
+
|
|
13
|
+
* **MessageEnvelope:** clean up ([72140f6](https://github.com/weyoss/redis-smq/commit/72140f61742dd4e3cbe36a6c421bf5f0b5a2f7ac))
|
|
14
|
+
* rename _createRMessage to _createConsumableMessage ([7a138fd](https://github.com/weyoss/redis-smq/commit/7a138fdce633946d4f69a7c8aa4d78a019bc82df))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Tests
|
|
18
|
+
|
|
19
|
+
* **ConsumableMessage:** increase code coverage ([3960c6e](https://github.com/weyoss/redis-smq/commit/3960c6ef72875fcdd0684eb1025afd0c0630c67c))
|
|
20
|
+
|
|
21
|
+
## [8.0.0-rc.10](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.9...v8.0.0-rc.10) (2023-12-17)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### ⚠ BREAKING CHANGES
|
|
25
|
+
|
|
26
|
+
* add ProducibleMessage/ConsumableMessage/MessageEnvelope
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add ProducibleMessage/ConsumableMessage/MessageEnvelope ([4a3eec7](https://github.com/weyoss/redis-smq/commit/4a3eec79575b2845d2c35ec478b89e4a5acb863d))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Documentation
|
|
34
|
+
|
|
35
|
+
* add ProducibleMessage/ConsumableMessage/MessageEnvelope ([55aa68e](https://github.com/weyoss/redis-smq/commit/55aa68e17021afadad32ee2c1b9dfef6924449f5))
|
|
36
|
+
* **QueueMessages:** fix outdated class reference ([e6ae499](https://github.com/weyoss/redis-smq/commit/e6ae4991d4389e1d1602bd780f4e0d95e02e5606))
|
|
37
|
+
* update examples ([bbccf7c](https://github.com/weyoss/redis-smq/commit/bbccf7cb5a2a5dfe2eacaeabb097129cbdcf6720))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Tests
|
|
41
|
+
|
|
42
|
+
* add ProducibleMessage/ConsumableMessage/MessageEnvelope ([2961a22](https://github.com/weyoss/redis-smq/commit/2961a221190307c4a4a8857fed9ec12622bdd10d))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Misc
|
|
46
|
+
|
|
47
|
+
* update health-check ([81edb25](https://github.com/weyoss/redis-smq/commit/81edb255d081824143f147ed8d0faefe0948224f))
|
|
48
|
+
|
|
49
|
+
## [8.0.0-rc.9](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.8...v8.0.0-rc.9) (2023-12-11)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Documentation
|
|
53
|
+
|
|
54
|
+
* update documentation ([85d6adb](https://github.com/weyoss/redis-smq/commit/85d6adb7e8db6cb4f427a34e8e510c11d2fc5bf0))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Codebase Refactoring
|
|
58
|
+
|
|
59
|
+
* **MessageEnvelope:** improve setPriority/getPriority typings ([91c44f0](https://github.com/weyoss/redis-smq/commit/91c44f013d6ff757876a0e57dcec45869ab6a02a))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Tests
|
|
63
|
+
|
|
64
|
+
* **MessageEnvelope:** improve setPriority/getPriority typings ([20fd6e5](https://github.com/weyoss/redis-smq/commit/20fd6e58e466ae425bba54d4d85adf4df888654b))
|
|
65
|
+
|
|
66
|
+
## [8.0.0-rc.8](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.7...v8.0.0-rc.8) (2023-12-11)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### ⚠ BREAKING CHANGES
|
|
70
|
+
|
|
71
|
+
* **Message:** remove Message.MessagePriority, add EMessagePriority
|
|
72
|
+
* **QueueMessages:** move message methods to Message,add MessageEnvelope
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* **Message:** add getMessageStatus() method ([fda81fa](https://github.com/weyoss/redis-smq/commit/fda81fa7a3c4428799dfabef8581f0f3b39949e8))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* **Message:** export missing error classes ([29e8817](https://github.com/weyoss/redis-smq/commit/29e8817fa805faed42ebd9a3fea469004552eec1))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Documentation
|
|
85
|
+
|
|
86
|
+
* update documentation and examples ([8efb082](https://github.com/weyoss/redis-smq/commit/8efb08200ac1f2751c7e10e3492445badb2e4039))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Codebase Refactoring
|
|
90
|
+
|
|
91
|
+
* **Message:** remove Message.MessagePriority, add EMessagePriority ([702a01d](https://github.com/weyoss/redis-smq/commit/702a01da987479a4f3b2127b9da0851d74046c10))
|
|
92
|
+
* **QueueMessages:** move message methods to Message,add MessageEnvelope ([f71f0d0](https://github.com/weyoss/redis-smq/commit/f71f0d06240e16b1519ae175793ae28470684d4f))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Tests
|
|
96
|
+
|
|
97
|
+
* **Message:** add getMessageStatus() method ([76e97c4](https://github.com/weyoss/redis-smq/commit/76e97c48fdc86c2709db39b17a0ba55432157270))
|
|
98
|
+
* **Message:** remove Message.MessagePriority, add EMessagePriority ([88a1368](https://github.com/weyoss/redis-smq/commit/88a1368ff8e000f3f26141ec29fddc7f96a7103e))
|
|
99
|
+
* **QueueMessages:** move message methods to Message,add MessageEnvelope ([932a88e](https://github.com/weyoss/redis-smq/commit/932a88eee5bfd0dc020c8516f76e2d351d486fe3))
|
|
100
|
+
|
|
101
|
+
## [8.0.0-rc.7](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.6...v8.0.0-rc.7) (2023-12-09)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### ⚠ BREAKING CHANGES
|
|
105
|
+
|
|
106
|
+
* **QueueMessages:** remove redundant method deleteMessage()
|
|
107
|
+
|
|
108
|
+
### Documentation
|
|
109
|
+
|
|
110
|
+
* **QueueMessages:** remove redundant method deleteMessage() ([cdeb454](https://github.com/weyoss/redis-smq/commit/cdeb4543f859e108efdcaa61aeac15d3a325b0a5))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### Codebase Refactoring
|
|
114
|
+
|
|
115
|
+
* **QueueMessages:** remove redundant method deleteMessage() ([af21dff](https://github.com/weyoss/redis-smq/commit/af21dff9f6b959ed21aa4cbe812606c1efbf4046))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Tests
|
|
119
|
+
|
|
120
|
+
* **QueueMessages:** remove redundant method deleteMessage() ([dfa3792](https://github.com/weyoss/redis-smq/commit/dfa37924a0a8e2fc726ce4a76baa535c79f0c917))
|
|
121
|
+
|
|
122
|
+
## [8.0.0-rc.6](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.5...v8.0.0-rc.6) (2023-12-09)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### ⚠ BREAKING CHANGES
|
|
126
|
+
|
|
127
|
+
* **QueueMessages:** rename deleteMessagesById to deleteMessageById
|
|
128
|
+
|
|
129
|
+
### Documentation
|
|
130
|
+
|
|
131
|
+
* **QueueMessages:** rename deleteMessagesById to deleteMessageById ([81cfb72](https://github.com/weyoss/redis-smq/commit/81cfb72a012e99398435418f52c8a24018759234))
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Codebase Refactoring
|
|
135
|
+
|
|
136
|
+
* **QueueMessages:** rename deleteMessagesById to deleteMessageById ([b3baf71](https://github.com/weyoss/redis-smq/commit/b3baf711e6210034aac256362418dd8d87859557))
|
|
137
|
+
|
|
138
|
+
## [8.0.0-rc.5](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.4...v8.0.0-rc.5) (2023-12-03)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### Documentation
|
|
142
|
+
|
|
143
|
+
* clean up ([2d7c004](https://github.com/weyoss/redis-smq/commit/2d7c004e690ca2f30a6de8d22feb5f4a3711eab9))
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### Codebase Refactoring
|
|
147
|
+
|
|
148
|
+
* improve typings ([c86bb53](https://github.com/weyoss/redis-smq/commit/c86bb53969bbb919f115268cbf510c818af44066))
|
|
149
|
+
|
|
150
|
+
## [8.0.0-rc.4](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.3...v8.0.0-rc.4) (2023-12-02)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Documentation
|
|
154
|
+
|
|
155
|
+
* clean up outdated examples ([dd1c68b](https://github.com/weyoss/redis-smq/commit/dd1c68bdd7cf7de2dfa309dbe7efff76fed5c983))
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Misc
|
|
159
|
+
|
|
160
|
+
* move redis-smq-common from dev-deps to deps ([675880d](https://github.com/weyoss/redis-smq/commit/675880d3803cca9c89aa860486bae43dbe7e2f70))
|
|
161
|
+
|
|
162
|
+
## [8.0.0-rc.3](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.2...v8.0.0-rc.3) (2023-12-02)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
|
|
167
|
+
* **scheduler:** handle unacked messages with retry delay correctly ([a97b145](https://github.com/weyoss/redis-smq/commit/a97b145f605d6b5c7d9f6f83c844c9d2447c5786))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Documentation
|
|
171
|
+
|
|
172
|
+
* update Message reference ([1cff3e3](https://github.com/weyoss/redis-smq/commit/1cff3e3fe3634ffa2d502a4bbb589948ed8e56ea))
|
|
173
|
+
* update TRedisSMQEvent reference ([5afa22e](https://github.com/weyoss/redis-smq/commit/5afa22ea1d2de00cb9c4708c55ec8fe1ef5a39b5))
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### Tests
|
|
177
|
+
|
|
178
|
+
* **message:** add new test cases covering message status ([9eec7e9](https://github.com/weyoss/redis-smq/commit/9eec7e9e2a39244ab62b9f8db4d049d3363a534d))
|
|
179
|
+
|
|
180
|
+
## [8.0.0-rc.2](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.1...v8.0.0-rc.2) (2023-11-27)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### ⚠ BREAKING CHANGES
|
|
184
|
+
|
|
185
|
+
* **events:** use typed events, remove legacy events
|
|
186
|
+
* add message status, return message IDs for produced messages
|
|
187
|
+
|
|
188
|
+
### Features
|
|
189
|
+
|
|
190
|
+
* add message status, return message IDs for produced messages ([56566bf](https://github.com/weyoss/redis-smq/commit/56566bf77d180a3b8a2baf0659f9bfc4861c71b3))
|
|
191
|
+
* **events:** use typed events, remove legacy events ([5f5a34f](https://github.com/weyoss/redis-smq/commit/5f5a34f11b51949c761a83301a087a682a105a89))
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Documentation
|
|
195
|
+
|
|
196
|
+
* **README.md:** update features description ([4ac300e](https://github.com/weyoss/redis-smq/commit/4ac300e71ef758d30f24810205732fd8b1d61b55))
|
|
197
|
+
* update configuration.md ([83ce680](https://github.com/weyoss/redis-smq/commit/83ce680d4ba06901d4b524c542036d8f661a8af4))
|
|
198
|
+
* use typed events, remove legacy events ([7c899f8](https://github.com/weyoss/redis-smq/commit/7c899f81f3eb66084d1b94b818d549800d453334))
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
### Tests
|
|
202
|
+
|
|
203
|
+
* add message status, return message IDs for produced messages ([8e3c228](https://github.com/weyoss/redis-smq/commit/8e3c22854940e7de3ab911e99cba64793b6ef7a5))
|
|
204
|
+
* use typed events, remove legacy events ([5d85cb0](https://github.com/weyoss/redis-smq/commit/5d85cb006b49cae97a214012e0f249399357c76a))
|
|
205
|
+
|
|
3
206
|
## [8.0.0-rc.1](https://github.com/weyoss/redis-smq/compare/v8.0.0-rc.0...v8.0.0-rc.1) (2023-11-21)
|
|
4
207
|
|
|
5
208
|
|
|
@@ -78,8 +281,6 @@
|
|
|
78
281
|
* drop support for redis server 2.8 and 3 ([9ef8ade](https://github.com/weyoss/redis-smq/commit/9ef8adec08bf90d1cc27b9bbabe591bca25a7d8e))
|
|
79
282
|
* update minimal supported versions for nodejs and redis ([13b3197](https://github.com/weyoss/redis-smq/commit/13b31977937c65aa989de8d715022d1afb5f0839))
|
|
80
283
|
|
|
81
|
-
# CHANGELOG
|
|
82
|
-
|
|
83
284
|
## 7.2.3 (2023-03-26)
|
|
84
285
|
|
|
85
286
|
* test(consumer-heartbeat): update tests (4332153)
|
package/README.md
CHANGED
|
@@ -17,22 +17,19 @@ RedisSMQ is a Node.js library for queuing messages (aka jobs) and processing the
|
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* **[Configurable](docs/configuration.md)**: Many options and features can be configured.
|
|
34
|
-
* **[Multiple Redis clients](docs/configuration.md)**: Depending on your preferences, RedisSMQ can use either [node-redis v3](https://github.com/redis/node-redis/tree/v3.1.2), [node-redis v4](https://github.com/redis/node-redis), or [ioredis](https://github.com/luin/ioredis).
|
|
35
|
-
* **[Highly optimized](https://lgtm.com/projects/g/weyoss/redis-smq/context:javascript)**: Strongly-typed and 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).
|
|
20
|
+
* [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), focuses on simplicity and without tons of features. This makes RedisSMQ an ideal message broker for microservices-based applications.
|
|
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).
|
|
23
|
+
* 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
|
+
* 3 queuing strategies that you may use depending on your needs and requirements: [FIFO queues, LIFO queues, and Reliable Priority Queues](docs/queues.md).
|
|
25
|
+
* A message can be [set to expire](docs/api/classes/ProducibleMessage.md#setttl) if it has not been delivered within a given amount of time. [Consumption timeout](docs/api/classes/ProducibleMessage.md#setconsumetimeout) allows canceling a message consumption if a consumer did not acknowledge the message for a period of time.
|
|
26
|
+
* [Queue Rate Limiting](docs/queue-rate-limiting.md) which allows to control the rate at which the messages are consumed from a given queue.
|
|
27
|
+
* Builtin [message scheduler](docs/scheduling-messages.md) allowing to delay a message, to deliver a message for N times with an optional period between deliveries, or simply to schedule message delivery using CRON expressions.
|
|
28
|
+
* [Multiplexing](/docs/multiplexing.md): A feature which allows message handlers to use a single redis connection to dequeue and consume messages.
|
|
29
|
+
* An [HTTP interface](https://github.com/weyoss/redis-smq-monitor) is provided to interact with the MQ. RedisSMQ can be managed also from your [web browser](https://github.com/weyoss/redis-smq-monitor-client).
|
|
30
|
+
* Depending on [your preferences](docs/configuration.md), RedisSMQ can use either [node-redis v3](https://github.com/redis/node-redis/tree/v3.1.2), [node-redis v4](https://github.com/redis/node-redis), or [ioredis](https://github.com/luin/ioredis).
|
|
31
|
+
* RedisSMQ is [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
|
+
* [Both ESM & CJS modules are supported](docs/esm-cjs-modules.md).
|
|
36
33
|
|
|
37
34
|
## RedisSMQ Use Case: Multi-Queue Producers & Multi-Queue Consumers
|
|
38
35
|
|
|
@@ -59,7 +56,7 @@ Considerations:
|
|
|
59
56
|
|
|
60
57
|
## Usage
|
|
61
58
|
|
|
62
|
-
RedisSMQ provides 3 classes in order to work with the message queue: `
|
|
59
|
+
RedisSMQ provides 3 classes in order to work with the message queue: `ProducibleMessage`, `Producer`, and `Consumer`.
|
|
63
60
|
|
|
64
61
|
Producers and consumers exchange data using one or multiple queues that may be created using the [Queue Class](docs/api/classes/Queue.md).
|
|
65
62
|
|
|
@@ -79,14 +76,14 @@ queue.save('my_queue', EQueueType.LIFO_QUEUE, (err) => console.log(err));
|
|
|
79
76
|
### Producing a message
|
|
80
77
|
|
|
81
78
|
```javascript
|
|
82
|
-
const { Producer,
|
|
79
|
+
const { Producer, ProducibleMessage } = require('redis-smq');
|
|
83
80
|
|
|
84
81
|
const producer = new Producer();
|
|
85
82
|
|
|
86
|
-
const
|
|
87
|
-
|
|
83
|
+
const msg = new ProducibleMessage();
|
|
84
|
+
msg.setQueue('my_queue').setBody('Hello Word!')
|
|
88
85
|
|
|
89
|
-
producer.produce(
|
|
86
|
+
producer.produce(msg, (err) => console.log(err));
|
|
90
87
|
```
|
|
91
88
|
|
|
92
89
|
### Consuming a message
|
|
@@ -95,8 +92,8 @@ producer.produce(message, (err) => console.log(err));
|
|
|
95
92
|
const { Consumer } = require('redis-smq');
|
|
96
93
|
|
|
97
94
|
const consumer = new Consumer();
|
|
98
|
-
const messageHandler = (
|
|
99
|
-
console.log(
|
|
95
|
+
const messageHandler = (msg, cb) => {
|
|
96
|
+
console.log(msg.getBody());
|
|
100
97
|
cb();
|
|
101
98
|
}
|
|
102
99
|
consumer.consume('my_queue', messageHandler, (err) => console.log(err));
|