@imqueue/core 3.2.4 → 3.2.5
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 +1 -1
- package/package.json +1 -1
- package/src/IMessageQueue.d.ts +30 -9
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imqueue/core",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"description": "Fast JSON message queue over Redis for inter-service communication in Node.js & TypeScript microservices — the transport layer of the @imqueue framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"message-queue",
|
package/src/IMessageQueue.d.ts
CHANGED
|
@@ -203,19 +203,38 @@ export interface IMQOptions extends Partial<IMessageQueueConnection> {
|
|
|
203
203
|
*/
|
|
204
204
|
useGzip?: boolean;
|
|
205
205
|
/**
|
|
206
|
-
* Enable guaranteed message delivery. When enabled,
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* that
|
|
206
|
+
* Enable guaranteed message delivery. When enabled, reading a message
|
|
207
|
+
* moves it atomically out of the queue into a worker-owned key instead of
|
|
208
|
+
* popping it outright, so a worker that dies *before* it starts on a
|
|
209
|
+
* message leaves that message behind for the watcher to re-queue rather
|
|
210
|
+
* than taking it down with the process.
|
|
211
|
+
*
|
|
212
|
+
* The guarantee covers that hand-off, not the processing. The worker key
|
|
213
|
+
* is released as soon as the message is dispatched to the `message`
|
|
214
|
+
* listener, so a worker killed while its handler is still running loses
|
|
215
|
+
* that message exactly as it would with safe delivery off — draining
|
|
216
|
+
* in-flight work before exit is up to the application. Delivery is
|
|
217
|
+
* at-least-once in either mode, so handlers should be idempotent.
|
|
210
218
|
*
|
|
219
|
+
* @default false
|
|
211
220
|
* @type {boolean}
|
|
212
221
|
*/
|
|
213
222
|
safeDelivery?: boolean;
|
|
214
223
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
224
|
+
* Lease deadline (in milliseconds) stamped onto the worker key when
|
|
225
|
+
* safeDelivery moves a message out of the queue, and the interval on which
|
|
226
|
+
* the watcher sweeps for expired keys. A worker key still present once its
|
|
227
|
+
* deadline has passed is treated as abandoned, and its message is moved
|
|
228
|
+
* back onto the main queue.
|
|
229
|
+
*
|
|
230
|
+
* This is a recovery deadline for an abandoned hand-off, not a processing
|
|
231
|
+
* deadline. The key is released when the message is dispatched, so a slow
|
|
232
|
+
* handler is neither interrupted nor re-queued for taking too long, and
|
|
233
|
+
* raising this value extends no protection over long-running work — tune it
|
|
234
|
+
* for how quickly an abandoned message should come back. Only effective
|
|
235
|
+
* when safeDelivery is enabled.
|
|
218
236
|
*
|
|
237
|
+
* @default 5000
|
|
219
238
|
* @type {number}
|
|
220
239
|
*/
|
|
221
240
|
safeDeliveryTtl?: number;
|
|
@@ -234,8 +253,10 @@ export interface IMQOptions extends Partial<IMessageQueueConnection> {
|
|
|
234
253
|
clusterManagers?: ClusterManager[];
|
|
235
254
|
/**
|
|
236
255
|
* Enable process signal handling (SIGTERM, SIGINT, SIGABRT) by the queue.
|
|
237
|
-
* When enabled, the queue releases its watcher lock
|
|
238
|
-
*
|
|
256
|
+
* When enabled, the queue releases its watcher lock on these signals and
|
|
257
|
+
* then exits the process. It does not wait for in-flight `message` handlers
|
|
258
|
+
* to finish, so drain those yourself if work in progress must not be lost.
|
|
259
|
+
* Disable if the host application manages shutdown.
|
|
239
260
|
*
|
|
240
261
|
* @default true
|
|
241
262
|
* @type {boolean}
|