redis-smq 8.0.0-rc.0 → 8.0.0-rc.10

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 CHANGED
@@ -1,11 +1,213 @@
1
1
 
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * add ProducibleMessage/ConsumableMessage/MessageEnvelope
9
+
10
+ ### Features
11
+
12
+ * add ProducibleMessage/ConsumableMessage/MessageEnvelope ([4a3eec7](https://github.com/weyoss/redis-smq/commit/4a3eec79575b2845d2c35ec478b89e4a5acb863d))
13
+
14
+
15
+ ### Documentation
16
+
17
+ * add ProducibleMessage/ConsumableMessage/MessageEnvelope ([55aa68e](https://github.com/weyoss/redis-smq/commit/55aa68e17021afadad32ee2c1b9dfef6924449f5))
18
+ * **QueueMessages:** fix outdated class reference ([e6ae499](https://github.com/weyoss/redis-smq/commit/e6ae4991d4389e1d1602bd780f4e0d95e02e5606))
19
+ * update examples ([bbccf7c](https://github.com/weyoss/redis-smq/commit/bbccf7cb5a2a5dfe2eacaeabb097129cbdcf6720))
20
+
21
+
22
+ ### Tests
23
+
24
+ * add ProducibleMessage/ConsumableMessage/MessageEnvelope ([2961a22](https://github.com/weyoss/redis-smq/commit/2961a221190307c4a4a8857fed9ec12622bdd10d))
25
+
26
+
27
+ ### Misc
28
+
29
+ * update health-check ([81edb25](https://github.com/weyoss/redis-smq/commit/81edb255d081824143f147ed8d0faefe0948224f))
30
+
31
+ ## [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)
32
+
33
+
34
+ ### Documentation
35
+
36
+ * update documentation ([85d6adb](https://github.com/weyoss/redis-smq/commit/85d6adb7e8db6cb4f427a34e8e510c11d2fc5bf0))
37
+
38
+
39
+ ### Codebase Refactoring
40
+
41
+ * **MessageEnvelope:** improve setPriority/getPriority typings ([91c44f0](https://github.com/weyoss/redis-smq/commit/91c44f013d6ff757876a0e57dcec45869ab6a02a))
42
+
43
+
44
+ ### Tests
45
+
46
+ * **MessageEnvelope:** improve setPriority/getPriority typings ([20fd6e5](https://github.com/weyoss/redis-smq/commit/20fd6e58e466ae425bba54d4d85adf4df888654b))
47
+
48
+ ## [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)
49
+
50
+
51
+ ### ⚠ BREAKING CHANGES
52
+
53
+ * **Message:** remove Message.MessagePriority, add EMessagePriority
54
+ * **QueueMessages:** move message methods to Message,add MessageEnvelope
55
+
56
+ ### Features
57
+
58
+ * **Message:** add getMessageStatus() method ([fda81fa](https://github.com/weyoss/redis-smq/commit/fda81fa7a3c4428799dfabef8581f0f3b39949e8))
59
+
60
+
61
+ ### Bug Fixes
62
+
63
+ * **Message:** export missing error classes ([29e8817](https://github.com/weyoss/redis-smq/commit/29e8817fa805faed42ebd9a3fea469004552eec1))
64
+
65
+
66
+ ### Documentation
67
+
68
+ * update documentation and examples ([8efb082](https://github.com/weyoss/redis-smq/commit/8efb08200ac1f2751c7e10e3492445badb2e4039))
69
+
70
+
71
+ ### Codebase Refactoring
72
+
73
+ * **Message:** remove Message.MessagePriority, add EMessagePriority ([702a01d](https://github.com/weyoss/redis-smq/commit/702a01da987479a4f3b2127b9da0851d74046c10))
74
+ * **QueueMessages:** move message methods to Message,add MessageEnvelope ([f71f0d0](https://github.com/weyoss/redis-smq/commit/f71f0d06240e16b1519ae175793ae28470684d4f))
75
+
76
+
77
+ ### Tests
78
+
79
+ * **Message:** add getMessageStatus() method ([76e97c4](https://github.com/weyoss/redis-smq/commit/76e97c48fdc86c2709db39b17a0ba55432157270))
80
+ * **Message:** remove Message.MessagePriority, add EMessagePriority ([88a1368](https://github.com/weyoss/redis-smq/commit/88a1368ff8e000f3f26141ec29fddc7f96a7103e))
81
+ * **QueueMessages:** move message methods to Message,add MessageEnvelope ([932a88e](https://github.com/weyoss/redis-smq/commit/932a88eee5bfd0dc020c8516f76e2d351d486fe3))
82
+
83
+ ## [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)
84
+
85
+
86
+ ### ⚠ BREAKING CHANGES
87
+
88
+ * **QueueMessages:** remove redundant method deleteMessage()
89
+
90
+ ### Documentation
91
+
92
+ * **QueueMessages:** remove redundant method deleteMessage() ([cdeb454](https://github.com/weyoss/redis-smq/commit/cdeb4543f859e108efdcaa61aeac15d3a325b0a5))
93
+
94
+
95
+ ### Codebase Refactoring
96
+
97
+ * **QueueMessages:** remove redundant method deleteMessage() ([af21dff](https://github.com/weyoss/redis-smq/commit/af21dff9f6b959ed21aa4cbe812606c1efbf4046))
98
+
99
+
100
+ ### Tests
101
+
102
+ * **QueueMessages:** remove redundant method deleteMessage() ([dfa3792](https://github.com/weyoss/redis-smq/commit/dfa37924a0a8e2fc726ce4a76baa535c79f0c917))
103
+
104
+ ## [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)
105
+
106
+
107
+ ### ⚠ BREAKING CHANGES
108
+
109
+ * **QueueMessages:** rename deleteMessagesById to deleteMessageById
110
+
111
+ ### Documentation
112
+
113
+ * **QueueMessages:** rename deleteMessagesById to deleteMessageById ([81cfb72](https://github.com/weyoss/redis-smq/commit/81cfb72a012e99398435418f52c8a24018759234))
114
+
115
+
116
+ ### Codebase Refactoring
117
+
118
+ * **QueueMessages:** rename deleteMessagesById to deleteMessageById ([b3baf71](https://github.com/weyoss/redis-smq/commit/b3baf711e6210034aac256362418dd8d87859557))
119
+
120
+ ## [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)
121
+
122
+
123
+ ### Documentation
124
+
125
+ * clean up ([2d7c004](https://github.com/weyoss/redis-smq/commit/2d7c004e690ca2f30a6de8d22feb5f4a3711eab9))
126
+
127
+
128
+ ### Codebase Refactoring
129
+
130
+ * improve typings ([c86bb53](https://github.com/weyoss/redis-smq/commit/c86bb53969bbb919f115268cbf510c818af44066))
131
+
132
+ ## [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)
133
+
134
+
135
+ ### Documentation
136
+
137
+ * clean up outdated examples ([dd1c68b](https://github.com/weyoss/redis-smq/commit/dd1c68bdd7cf7de2dfa309dbe7efff76fed5c983))
138
+
139
+
140
+ ### Misc
141
+
142
+ * move redis-smq-common from dev-deps to deps ([675880d](https://github.com/weyoss/redis-smq/commit/675880d3803cca9c89aa860486bae43dbe7e2f70))
143
+
144
+ ## [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)
145
+
146
+
147
+ ### Bug Fixes
148
+
149
+ * **scheduler:** handle unacked messages with retry delay correctly ([a97b145](https://github.com/weyoss/redis-smq/commit/a97b145f605d6b5c7d9f6f83c844c9d2447c5786))
150
+
151
+
152
+ ### Documentation
153
+
154
+ * update Message reference ([1cff3e3](https://github.com/weyoss/redis-smq/commit/1cff3e3fe3634ffa2d502a4bbb589948ed8e56ea))
155
+ * update TRedisSMQEvent reference ([5afa22e](https://github.com/weyoss/redis-smq/commit/5afa22ea1d2de00cb9c4708c55ec8fe1ef5a39b5))
156
+
157
+
158
+ ### Tests
159
+
160
+ * **message:** add new test cases covering message status ([9eec7e9](https://github.com/weyoss/redis-smq/commit/9eec7e9e2a39244ab62b9f8db4d049d3363a534d))
161
+
162
+ ## [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)
163
+
164
+
165
+ ### ⚠ BREAKING CHANGES
166
+
167
+ * **events:** use typed events, remove legacy events
168
+ * add message status, return message IDs for produced messages
169
+
170
+ ### Features
171
+
172
+ * add message status, return message IDs for produced messages ([56566bf](https://github.com/weyoss/redis-smq/commit/56566bf77d180a3b8a2baf0659f9bfc4861c71b3))
173
+ * **events:** use typed events, remove legacy events ([5f5a34f](https://github.com/weyoss/redis-smq/commit/5f5a34f11b51949c761a83301a087a682a105a89))
174
+
175
+
176
+ ### Documentation
177
+
178
+ * **README.md:** update features description ([4ac300e](https://github.com/weyoss/redis-smq/commit/4ac300e71ef758d30f24810205732fd8b1d61b55))
179
+ * update configuration.md ([83ce680](https://github.com/weyoss/redis-smq/commit/83ce680d4ba06901d4b524c542036d8f661a8af4))
180
+ * use typed events, remove legacy events ([7c899f8](https://github.com/weyoss/redis-smq/commit/7c899f81f3eb66084d1b94b818d549800d453334))
181
+
182
+
183
+ ### Tests
184
+
185
+ * add message status, return message IDs for produced messages ([8e3c228](https://github.com/weyoss/redis-smq/commit/8e3c22854940e7de3ab911e99cba64793b6ef7a5))
186
+ * use typed events, remove legacy events ([5d85cb0](https://github.com/weyoss/redis-smq/commit/5d85cb006b49cae97a214012e0f249399357c76a))
187
+
188
+ ## [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)
189
+
190
+
191
+ ### Codebase Refactoring
192
+
193
+ * pass keyQueueMessages as a key for SCHEDULE_MESSAGE script ([f9f69b3](https://github.com/weyoss/redis-smq/commit/f9f69b3359c63702974946d9ae486b1a59a38485))
194
+
195
+
196
+ ### Tests
197
+
198
+ * fix unpredictable error throwing when deleting a namespace ([4126670](https://github.com/weyoss/redis-smq/commit/4126670ca283073c42e69e80e5fc95f1eaf95a92))
199
+
200
+
201
+ ### Misc
202
+
203
+ * update lint-staged configuration ([9543401](https://github.com/weyoss/redis-smq/commit/9543401acae6abed6eaa53aa9149e0306b2cad64))
204
+
3
205
  ## [8.0.0-rc.0](https://github.com/weyoss/redis-smq/compare/v7.2.3...v8.0.0-rc.0) (2023-11-20)
4
206
 
5
207
 
6
208
  ### ⚠ BREAKING CHANGES
7
209
 
8
- * use latest redis-smq-common release, fix broken changes
210
+ * use latest redis-smq-common release, fix breaking changes
9
211
 
10
212
  ### Features
11
213
 
@@ -35,12 +237,12 @@
35
237
  ### Codebase Refactoring
36
238
 
37
239
  * **queue:** use friendly keys for queue properties object ([9e88f54](https://github.com/weyoss/redis-smq/commit/9e88f54052a9b0bc89144e8d067f1818f0d32a13))
38
- * use latest redis-smq-common release, fix broken changes ([e347d4d](https://github.com/weyoss/redis-smq/commit/e347d4d148c3b104e7d73c9ef8d5bf796657c1d6))
240
+ * use latest redis-smq-common release, fix breaking changes ([e347d4d](https://github.com/weyoss/redis-smq/commit/e347d4d148c3b104e7d73c9ef8d5bf796657c1d6))
39
241
 
40
242
 
41
243
  ### Tests
42
244
 
43
- * fix broken changes from latest redis-smq-common ([30a6099](https://github.com/weyoss/redis-smq/commit/30a609981786cabd4d08e9277be5b0bab8ad86fb))
245
+ * fix breaking changes from latest redis-smq-common ([30a6099](https://github.com/weyoss/redis-smq/commit/30a609981786cabd4d08e9277be5b0bab8ad86fb))
44
246
  * fix QueueMessageNotFoundError checking ([6053cee](https://github.com/weyoss/redis-smq/commit/6053ceef7b7922bbb58eaf91d4d3a15baea34bb4))
45
247
  * fix tests ([561f0d0](https://github.com/weyoss/redis-smq/commit/561f0d06f0c4f28e6338def878210f2704b718b0))
46
248
 
@@ -61,8 +263,6 @@
61
263
  * drop support for redis server 2.8 and 3 ([9ef8ade](https://github.com/weyoss/redis-smq/commit/9ef8adec08bf90d1cc27b9bbabe591bca25a7d8e))
62
264
  * update minimal supported versions for nodejs and redis ([13b3197](https://github.com/weyoss/redis-smq/commit/13b31977937c65aa989de8d715022d1afb5f0839))
63
265
 
64
- # CHANGELOG
65
-
66
266
  ## 7.2.3 (2023-03-26)
67
267
 
68
268
  * 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
- * **[High-performance message processing](docs/performance.md)**.
21
- * **[Multi-Queue Producers](docs/producing-messages.md) & [Multi-Queue Consumers](docs/consuming-messages.md)**: Offering flexible Producer/Consumer models, with focus on simplicity and without tons of features. This can make RedisSMQ an ideal message broker for your microservices.
22
- * **[at-least-once/at-most-once Delivery](docs/api/classes/Message.md#setretrythreshold)**: In case of failures, while delivering or processing a message, RedisSMQ can guaranty that the message will be not lost and redelivered again. When configured to do so, RedisSMQ can also ensure that the message is delivered at-most-once.
23
- * **[Different Exchange Types](docs/message-exchanges.md)**: RedisSMQ offers 3 types of exchanges: [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
- * **[FIFO queues, LIFO queues, and Reliable Priority Queues](docs/queues.md)**: Provides different queuing strategies that you may use depending on your needs and requirements.
25
- * **[Message Expiration](docs/api/classes/Message.md#setttl)**: Allowing a message to expire if it has not been delivered within a given amount of time.
26
- * **[Message Consumption Timeout](docs/api/classes/Message.md#setconsumetimeout)**: Allowing to set up a timeout for consuming messages.
27
- * **[Queue Rate Limiting](docs/queue-rate-limiting.md)**: Allowing to control the rate at which the messages are consumed from a given queue.
28
- * **[Scheduling Messages](docs/scheduling-messages.md)**: Messages can be configured to be delayed, delivered for N times with an optional period between deliveries, and to be scheduled using CRON expressions.
29
- * **[Multiplexing](/docs/multiplexing.md)**: A feature which allows message handlers to use a single redis connection to dequeue and consume messages.
30
- * **[HTTP API](https://github.com/weyoss/redis-smq-monitor)**: an HTTP interface is provided to interact with the MQ.
31
- * **[Web UI](https://github.com/weyoss/redis-smq-monitor-client)**: RedisSMQ can be managed also from your web browser.
32
- * **[Logging](https://github.com/weyoss/redis-smq-common/blob/master/docs/logs.md)**: RedisSMQ comes with a built-in JSON logger, but can also use your application logger.
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: `Message`, `Producer`, and `Consumer`.
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, Message } = require('redis-smq');
79
+ const { Producer, ProducibleMessage } = require('redis-smq');
83
80
 
84
81
  const producer = new Producer();
85
82
 
86
- const message = new Message();
87
- message.setQueue('my_queue').setBody('Hello Word!')
83
+ const msg = new ProducibleMessage();
84
+ msg.setQueue('my_queue').setBody('Hello Word!')
88
85
 
89
- producer.produce(message, (err) => console.log(err));
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 = (message, cb) => {
99
- console.log(message.getBody());
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));