@vercel/queue 0.1.4 → 0.1.6
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/README.md +9 -9
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ await send(
|
|
|
92
92
|
{ message: "Hello world" },
|
|
93
93
|
{
|
|
94
94
|
idempotencyKey: "unique-key", // Prevent duplicate messages
|
|
95
|
-
retentionSeconds: 3600, // 1 hour TTL (default: 24h)
|
|
95
|
+
retentionSeconds: 3600, // 1 hour TTL (default: 24h, max: 7d)
|
|
96
96
|
delaySeconds: 60, // Delay delivery by 1 minute
|
|
97
97
|
region: "sfo1", // Top-level send() only — not available on QueueClient.send()
|
|
98
98
|
},
|
|
@@ -274,7 +274,7 @@ Multiple route files for the same topic create separate consumer groups — each
|
|
|
274
274
|
|
|
275
275
|
### 3. Retry and Backoff
|
|
276
276
|
|
|
277
|
-
When a handler throws, the message is not acknowledged and becomes available for redelivery after the `retryAfterSeconds` interval configured in `vercel.json`. Retries continue until the handler succeeds or the message expires (default: 24 hours).
|
|
277
|
+
When a handler throws, the message is not acknowledged and becomes available for redelivery after the `retryAfterSeconds` interval configured in `vercel.json`. Retries continue until the handler succeeds or the message expires (default: 24 hours, max: 7 days).
|
|
278
278
|
|
|
279
279
|
For finer control over retry timing, pass a `retry` option. You can also set `visibilityTimeoutSeconds` to control how long the message is locked during processing (default: 300):
|
|
280
280
|
|
|
@@ -570,11 +570,11 @@ All error types:
|
|
|
570
570
|
|
|
571
571
|
#### Publishing Messages
|
|
572
572
|
|
|
573
|
-
| Parameter | Default | Min | Max
|
|
574
|
-
| ------------------ | ------------ | --- |
|
|
575
|
-
| `retentionSeconds` | 86,400 (24h) | 60 |
|
|
576
|
-
| `delaySeconds` | 0 | 0 |
|
|
577
|
-
| `idempotencyKey` | — | — | —
|
|
573
|
+
| Parameter | Default | Min | Max | Notes |
|
|
574
|
+
| ------------------ | ------------ | --- | ------------ | ----------------------------------- |
|
|
575
|
+
| `retentionSeconds` | 86,400 (24h) | 60 | 604,800 (7d) | Message TTL |
|
|
576
|
+
| `delaySeconds` | 0 | 0 | 604,800 (7d) | Cannot exceed retention |
|
|
577
|
+
| `idempotencyKey` | — | — | — | Dedup window: `min(retention, 24h)` |
|
|
578
578
|
|
|
579
579
|
#### Receiving Messages
|
|
580
580
|
|
|
@@ -620,8 +620,8 @@ import { send } from "@vercel/queue";
|
|
|
620
620
|
|
|
621
621
|
const { messageId } = await send("my-topic", payload, {
|
|
622
622
|
idempotencyKey: "unique-key", // Dedup window: min(retention, 24h)
|
|
623
|
-
retentionSeconds: 3600, // Message TTL (default: 86400)
|
|
624
|
-
delaySeconds: 60, // Delay before visible (default: 0)
|
|
623
|
+
retentionSeconds: 3600, // Message TTL (default: 86400, max: 604800)
|
|
624
|
+
delaySeconds: 60, // Delay before visible (default: 0, max: 7d)
|
|
625
625
|
headers: { "X-Custom": "val" }, // Custom headers
|
|
626
626
|
region: "sfo1", // Override the auto-detected region for this send
|
|
627
627
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -260,7 +260,7 @@ interface SendOptions {
|
|
|
260
260
|
* Message retention time in seconds. After this period, the message expires.
|
|
261
261
|
* @default 86400 (24 hours)
|
|
262
262
|
* @minimum 60 (1 minute)
|
|
263
|
-
* @maximum
|
|
263
|
+
* @maximum 604800 (7 days)
|
|
264
264
|
*/
|
|
265
265
|
retentionSeconds?: number;
|
|
266
266
|
/**
|
|
@@ -268,7 +268,7 @@ interface SendOptions {
|
|
|
268
268
|
* The message will not be visible to consumers until the delay has passed.
|
|
269
269
|
* @default 0
|
|
270
270
|
* @minimum 0
|
|
271
|
-
* @maximum
|
|
271
|
+
* @maximum 604800 (7 days, cannot exceed retentionSeconds)
|
|
272
272
|
*/
|
|
273
273
|
delaySeconds?: number;
|
|
274
274
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -260,7 +260,7 @@ interface SendOptions {
|
|
|
260
260
|
* Message retention time in seconds. After this period, the message expires.
|
|
261
261
|
* @default 86400 (24 hours)
|
|
262
262
|
* @minimum 60 (1 minute)
|
|
263
|
-
* @maximum
|
|
263
|
+
* @maximum 604800 (7 days)
|
|
264
264
|
*/
|
|
265
265
|
retentionSeconds?: number;
|
|
266
266
|
/**
|
|
@@ -268,7 +268,7 @@ interface SendOptions {
|
|
|
268
268
|
* The message will not be visible to consumers until the delay has passed.
|
|
269
269
|
* @default 0
|
|
270
270
|
* @minimum 0
|
|
271
|
-
* @maximum
|
|
271
|
+
* @maximum 604800 (7 days, cannot exceed retentionSeconds)
|
|
272
272
|
*/
|
|
273
273
|
delaySeconds?: number;
|
|
274
274
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1640,7 +1640,7 @@ Cause: ${cause}`
|
|
|
1640
1640
|
}
|
|
1641
1641
|
console.debug("[VQS Debug] Request:", JSON.stringify(logData, null, 2));
|
|
1642
1642
|
}
|
|
1643
|
-
init.headers.set("User-Agent", `@vercel/queue/${"0.1.
|
|
1643
|
+
init.headers.set("User-Agent", `@vercel/queue/${"0.1.6"}`);
|
|
1644
1644
|
init.headers.set("Vqs-Client-Ts", (/* @__PURE__ */ new Date()).toISOString());
|
|
1645
1645
|
const fetchInit = this.dispatcher ? { ...init, dispatcher: this.dispatcher } : init;
|
|
1646
1646
|
const response = await fetch(url, fetchInit);
|