redis-smq 8.0.0-rc.7 → 8.0.0-rc.8

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,5 +1,40 @@
1
1
 
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **Message:** remove Message.MessagePriority, add EMessagePriority
9
+ * **QueueMessages:** move message methods to Message,add MessageEnvelope
10
+
11
+ ### Features
12
+
13
+ * **Message:** add getMessageStatus() method ([fda81fa](https://github.com/weyoss/redis-smq/commit/fda81fa7a3c4428799dfabef8581f0f3b39949e8))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **Message:** export missing error classes ([29e8817](https://github.com/weyoss/redis-smq/commit/29e8817fa805faed42ebd9a3fea469004552eec1))
19
+
20
+
21
+ ### Documentation
22
+
23
+ * update documentation and examples ([8efb082](https://github.com/weyoss/redis-smq/commit/8efb08200ac1f2751c7e10e3492445badb2e4039))
24
+
25
+
26
+ ### Codebase Refactoring
27
+
28
+ * **Message:** remove Message.MessagePriority, add EMessagePriority ([702a01d](https://github.com/weyoss/redis-smq/commit/702a01da987479a4f3b2127b9da0851d74046c10))
29
+ * **QueueMessages:** move message methods to Message,add MessageEnvelope ([f71f0d0](https://github.com/weyoss/redis-smq/commit/f71f0d06240e16b1519ae175793ae28470684d4f))
30
+
31
+
32
+ ### Tests
33
+
34
+ * **Message:** add getMessageStatus() method ([76e97c4](https://github.com/weyoss/redis-smq/commit/76e97c48fdc86c2709db39b17a0ba55432157270))
35
+ * **Message:** remove Message.MessagePriority, add EMessagePriority ([88a1368](https://github.com/weyoss/redis-smq/commit/88a1368ff8e000f3f26141ec29fddc7f96a7103e))
36
+ * **QueueMessages:** move message methods to Message,add MessageEnvelope ([932a88e](https://github.com/weyoss/redis-smq/commit/932a88eee5bfd0dc020c8516f76e2d351d486fe3))
37
+
3
38
  ## [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)
4
39
 
5
40
 
package/README.md CHANGED
@@ -19,10 +19,10 @@ RedisSMQ is a Node.js library for queuing messages (aka jobs) and processing the
19
19
 
20
20
  * [High-performance message processing](docs/performance.md).
21
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/Message.md#setretrythreshold). When configured to do so, RedisSMQ can also ensure that the message is delivered [at-most-once](docs/api/classes/Message.md#setretrythreshold).
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/MessageEnvelope.md#setretrythreshold). When configured to do so, RedisSMQ can also ensure that the message is delivered [at-most-once](docs/api/classes/MessageEnvelope.md#setretrythreshold).
23
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
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/Message.md#setttl) if it has not been delivered within a given amount of time. [Consumption timeout](docs/api/classes/Message.md#setconsumetimeout) allows canceling a message consumption if a consumer did not acknowledge the message for a period of time.
25
+ * A message can be [set to expire](docs/api/classes/MessageEnvelope.md#setttl) if it has not been delivered within a given amount of time. [Consumption timeout](docs/api/classes/MessageEnvelope.md#setconsumetimeout) allows canceling a message consumption if a consumer did not acknowledge the message for a period of time.
26
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
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
28
  * [Multiplexing](/docs/multiplexing.md): A feature which allows message handlers to use a single redis connection to dequeue and consume messages.
@@ -56,7 +56,7 @@ Considerations:
56
56
 
57
57
  ## Usage
58
58
 
59
- 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: `MessageEnvelope`, `Producer`, and `Consumer`.
60
60
 
61
61
  Producers and consumers exchange data using one or multiple queues that may be created using the [Queue Class](docs/api/classes/Queue.md).
62
62
 
@@ -76,14 +76,14 @@ queue.save('my_queue', EQueueType.LIFO_QUEUE, (err) => console.log(err));
76
76
  ### Producing a message
77
77
 
78
78
  ```javascript
79
- const { Producer, Message } = require('redis-smq');
79
+ const { Producer, MessageEnvelope } = require('redis-smq');
80
80
 
81
81
  const producer = new Producer();
82
82
 
83
- const message = new Message();
84
- message.setQueue('my_queue').setBody('Hello Word!')
83
+ const msg = new MessageEnvelope();
84
+ msg.setQueue('my_queue').setBody('Hello Word!')
85
85
 
86
- producer.produce(message, (err) => console.log(err));
86
+ producer.produce(msg, (err) => console.log(err));
87
87
  ```
88
88
 
89
89
  ### Consuming a message
@@ -92,8 +92,8 @@ producer.produce(message, (err) => console.log(err));
92
92
  const { Consumer } = require('redis-smq');
93
93
 
94
94
  const consumer = new Consumer();
95
- const messageHandler = (message, cb) => {
96
- console.log(message.getBody());
95
+ const messageHandler = (msg, cb) => {
96
+ console.log(msg.getBody());
97
97
  cb();
98
98
  }
99
99
  consumer.consume('my_queue', messageHandler, (err) => console.log(err));