@nestjs-transactional/outbox 1.0.0-alpha.5 → 1.1.0
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 +174 -335
- package/dist/api/failed-event-publications.js.map +1 -1
- package/dist/api/incomplete-event-publications.js +1 -2
- package/dist/api/incomplete-event-publications.js.map +1 -1
- package/dist/decorators/outbox-events-handler.decorator.d.ts +1 -1
- package/dist/decorators/outbox-events-handler.decorator.js.map +1 -1
- package/dist/dispatcher/data-source-outbox-publisher.d.ts +2 -3
- package/dist/dispatcher/data-source-outbox-publisher.js +2 -3
- package/dist/dispatcher/data-source-outbox-publisher.js.map +1 -1
- package/dist/dispatcher/event-publication-processor.d.ts +19 -2
- package/dist/dispatcher/event-publication-processor.js +40 -3
- package/dist/dispatcher/event-publication-processor.js.map +1 -1
- package/dist/dispatcher/outbox-event-publisher.d.ts +1 -1
- package/dist/dispatcher/outbox-event-publisher.js +2 -2
- package/dist/dispatcher/outbox-event-publisher.js.map +1 -1
- package/dist/dispatcher/processor-options.d.ts +13 -1
- package/dist/dispatcher/processor-options.js +4 -1
- package/dist/dispatcher/processor-options.js.map +1 -1
- package/dist/externalization/describe-thrown.d.ts +20 -0
- package/dist/externalization/describe-thrown.js +49 -0
- package/dist/externalization/describe-thrown.js.map +1 -0
- package/dist/externalization/event-externalizer.d.ts +2 -2
- package/dist/externalization/externalization-registry.js.map +1 -1
- package/dist/externalization/externalized.decorator.d.ts +3 -4
- package/dist/externalization/externalized.decorator.js +2 -3
- package/dist/externalization/externalized.decorator.js.map +1 -1
- package/dist/externalization/types.d.ts +2 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/module/outbox-processing.module.d.ts +18 -2
- package/dist/module/outbox-processing.module.js +33 -7
- package/dist/module/outbox-processing.module.js.map +1 -1
- package/dist/module/outbox.module.d.ts +15 -0
- package/dist/module/outbox.module.js +99 -8
- package/dist/module/outbox.module.js.map +1 -1
- package/dist/recovery/outbox-cleanup-scheduler.d.ts +56 -0
- package/dist/recovery/outbox-cleanup-scheduler.js +139 -0
- package/dist/recovery/outbox-cleanup-scheduler.js.map +1 -0
- package/dist/recovery/outbox-retry-scheduler.d.ts +68 -0
- package/dist/recovery/outbox-retry-scheduler.js +163 -0
- package/dist/recovery/outbox-retry-scheduler.js.map +1 -0
- package/dist/recovery/staleness-monitor.d.ts +10 -2
- package/dist/recovery/staleness-monitor.js +28 -3
- package/dist/recovery/staleness-monitor.js.map +1 -1
- package/dist/registry/event-publication-registry.d.ts +1 -1
- package/dist/registry/event-publication-registry.js +1 -1
- package/dist/registry/event-publication-registry.js.map +1 -1
- package/dist/registry/listener-registry.d.ts +2 -2
- package/dist/registry/listener-registry.js +2 -2
- package/dist/registry/multi-ds-listener-registrar.d.ts +10 -4
- package/dist/registry/multi-ds-listener-registrar.js +1 -1
- package/dist/registry/multi-ds-listener-registrar.js.map +1 -1
- package/dist/registry/outbox-listener-scanner.d.ts +1 -1
- package/dist/registry/outbox-listener-scanner.js +1 -1
- package/dist/registry/outbox-listener-scanner.js.map +1 -1
- package/dist/repository/event-publication-repository.d.ts +37 -6
- package/dist/repository/event-publication-repository.js.map +1 -1
- package/dist/serialization/event-type-resolver.d.ts +1 -1
- package/dist/serialization/event-type-resolver.js +1 -1
- package/dist/serialization/json-event-serializer.js.map +1 -1
- package/dist/shutdown/drain.d.ts +32 -0
- package/dist/shutdown/drain.js +56 -0
- package/dist/shutdown/drain.js.map +1 -0
- package/dist/testing/in-memory-repository.js +11 -2
- package/dist/testing/in-memory-repository.js.map +1 -1
- package/dist/testing/published-events.js +6 -2
- package/dist/testing/published-events.js.map +1 -1
- package/dist/tokens/token-utils.js.map +1 -1
- package/dist/types/cleanup-config.d.ts +59 -0
- package/dist/types/cleanup-config.js +17 -0
- package/dist/types/cleanup-config.js.map +1 -0
- package/dist/types/resubmission-options.d.ts +0 -4
- package/dist/types/resubmission-options.js +0 -9
- package/dist/types/resubmission-options.js.map +1 -1
- package/dist/types/retry-config.d.ts +51 -0
- package/dist/types/retry-config.js +16 -0
- package/dist/types/retry-config.js.map +1 -0
- package/dist/types/staleness-config.d.ts +8 -0
- package/dist/types/staleness-config.js +2 -0
- package/dist/types/staleness-config.js.map +1 -1
- package/package.json +25 -13
|
@@ -110,8 +110,7 @@ let InMemoryEventPublicationRepository = class InMemoryEventPublicationRepositor
|
|
|
110
110
|
}
|
|
111
111
|
async findReadyForProcessing(limit) {
|
|
112
112
|
return Array.from(this.publications.values())
|
|
113
|
-
.filter((p) => p.status === publication_status_1.PublicationStatus.PUBLISHED ||
|
|
114
|
-
p.status === publication_status_1.PublicationStatus.RESUBMITTED)
|
|
113
|
+
.filter((p) => p.status === publication_status_1.PublicationStatus.PUBLISHED || p.status === publication_status_1.PublicationStatus.RESUBMITTED)
|
|
115
114
|
.slice(0, limit);
|
|
116
115
|
}
|
|
117
116
|
async findStale(beforeDate, statuses) {
|
|
@@ -123,6 +122,16 @@ let InMemoryEventPublicationRepository = class InMemoryEventPublicationRepositor
|
|
|
123
122
|
if (olderThan) {
|
|
124
123
|
result = result.filter((p) => p.completionDate !== null && p.completionDate < olderThan);
|
|
125
124
|
}
|
|
125
|
+
// Oldest first, per the SPI contract. Insertion order happened to be
|
|
126
|
+
// close enough until `limit` made the order a correctness property
|
|
127
|
+
// for the retention job. A publication still in `COMPLETED` without a
|
|
128
|
+
// completion date cannot be ordered, so it sorts last rather than
|
|
129
|
+
// being dropped.
|
|
130
|
+
result = [...result].sort((a, b) => {
|
|
131
|
+
const left = a.completionDate?.getTime() ?? Number.POSITIVE_INFINITY;
|
|
132
|
+
const right = b.completionDate?.getTime() ?? Number.POSITIVE_INFINITY;
|
|
133
|
+
return left - right;
|
|
134
|
+
});
|
|
126
135
|
const limit = options?.limit;
|
|
127
136
|
if (limit !== undefined) {
|
|
128
137
|
result = result.slice(0, limit);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-repository.js","sourceRoot":"","sources":["../../src/testing/in-memory-repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,6CAAyC;AAEzC,2CAAsD;AACtD,qDAA8F;AAQ9F,4CAA2D;AAE3D,oEAAgE;
|
|
1
|
+
{"version":3,"file":"in-memory-repository.js","sourceRoot":"","sources":["../../src/testing/in-memory-repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,6CAAyC;AAEzC,2CAAsD;AACtD,qDAA8F;AAQ9F,4CAA2D;AAE3D,oEAAgE;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AAEI,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAK1B;IAJF,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;IAEpE,YAEmB,kBAAuC;QAAvC,uBAAkB,GAAlB,kBAAkB,CAAqB;IACvD,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,MAA6B;QAC3C,MAAM,OAAO,GAAuB,EAAE,CAAC;QACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,WAAW,GAAqB;gBACpC,EAAE,EAAE,IAAA,wBAAU,GAAE;gBAChB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,eAAe,EAAE,KAAK,CAAC,eAAe;gBACtC,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,IAAI,IAAI,EAAE;gBACpD,MAAM,EAAE,sCAAiB,CAAC,SAAS;gBACnC,cAAc,EAAE,IAAI;gBACpB,oBAAoB,EAAE,IAAI;gBAC1B,kBAAkB,EAAE,CAAC;gBACrB,aAAa,EAAE,IAAI;aACpB,CAAC;YACF,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;YACnD,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5B,CAA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C;IAED,gDAAgD;IAEhD,0EAA0E;IAC1E,KAAK;QACH,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,gEAAgE;IAChE,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,qCAAqC;IACrC,KAAK;QACH,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACK,aAAa,CAAC,IAAgB;QACpC,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO;QACT,CAAC;QACD,IAAI,CAAC;YACH,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,KAAK,IAAI,EAAE;gBACvD,IAAI,EAAE,CAAC;YACT,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,mCAA4B,EAAE,CAAC;gBAChD,OAAO;YACT,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF,CAAA;AA7OY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAC2B,yBAAkB;GAL/C,kCAAkC,CA6O9C"}
|
|
@@ -86,12 +86,16 @@ class PublishedEventsView {
|
|
|
86
86
|
this.predicates = predicates;
|
|
87
87
|
}
|
|
88
88
|
matching(fnOrGetter, expected) {
|
|
89
|
-
//
|
|
89
|
+
// `arguments.length` distinguishes the two overloads reliably,
|
|
90
|
+
// including when `expected` is intentionally passed as `undefined`.
|
|
90
91
|
const argCount = arguments.length;
|
|
91
92
|
const predicate = argCount > 1
|
|
92
93
|
? (event) => fnOrGetter(event) === expected
|
|
93
94
|
: fnOrGetter;
|
|
94
|
-
return new PublishedEventsView(this.fetchAll, this.serializer, this.eventType, [
|
|
95
|
+
return new PublishedEventsView(this.fetchAll, this.serializer, this.eventType, [
|
|
96
|
+
...this.predicates,
|
|
97
|
+
predicate,
|
|
98
|
+
]);
|
|
95
99
|
}
|
|
96
100
|
/** Number of matching events. Materialises the view. */
|
|
97
101
|
async count() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"published-events.js","sourceRoot":"","sources":["../../src/testing/published-events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAE/D,6FAGoD;AACpD,wEAA2F;AAG3F;;;;;;;;;;;GAWG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IAGP;IAEA;IAJnB,YAEmB,UAAsC,EAEtC,UAA2B;QAF3B,eAAU,GAAV,UAAU,CAA4B;QAEtC,eAAU,GAAV,UAAU,CAAiB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"published-events.js","sourceRoot":"","sources":["../../src/testing/published-events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAE/D,6FAGoD;AACpD,wEAA2F;AAG3F;;;;;;;;;;;GAWG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IAGP;IAEA;IAJnB,YAEmB,UAAsC,EAEtC,UAA2B;QAF3B,eAAU,GAAV,UAAU,CAA4B;QAEtC,eAAU,GAAV,UAAU,CAAiB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,EA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UAAoC,CAAC;QAE5C,OAAO,IAAI,mBAAmB,CAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE;YAChF,GAAG,IAAI,CAAC,UAAU;YAClB,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IACnC,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnC,MAAM,KAAK,GAAQ,IAAI;aACpB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aACtD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,SAAS,CAAM,CAAC,CAAC;QACtF,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;CACF;AAhDD,kDAgDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-utils.js","sourceRoot":"","sources":["../../src/tokens/token-utils.ts"],"names":[],"mappings":";;AAmBA,
|
|
1
|
+
{"version":3,"file":"token-utils.js","sourceRoot":"","sources":["../../src/tokens/token-utils.ts"],"names":[],"mappings":";;AAmBA,0DAEC;AAQD,8DAEC;AAMD,4EAIC;AAOD,8EAIC;AAQD,wEAIC;AAKD,0EAIC;AAOD,gFAIC;AAQD,8DAEC;AASD,sEAIC;AA3GD,qDAAsE;AAEtE;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,aAAqB,+BAAwB;IACnF,OAAO,GAAG,UAAU,sBAAsB,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,aAAqB,+BAAwB;IACrF,OAAO,GAAG,UAAU,mBAAmB,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,SAAgB,gCAAgC,CAC9C,aAAqB,+BAAwB;IAE7C,OAAO,GAAG,UAAU,0BAA0B,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,SAAgB,iCAAiC,CAC/C,aAAqB,+BAAwB;IAE7C,OAAO,GAAG,UAAU,2BAA2B,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,8BAA8B,CAC5C,aAAqB,+BAAwB;IAE7C,OAAO,GAAG,UAAU,wBAAwB,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,SAAgB,+BAA+B,CAC7C,aAAqB,+BAAwB;IAE7C,OAAO,GAAG,UAAU,yBAAyB,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,SAAgB,kCAAkC,CAChD,aAAqB,+BAAwB;IAE7C,OAAO,GAAG,UAAU,4BAA4B,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,aAAqB,+BAAwB;IACrF,OAAO,GAAG,UAAU,mBAAmB,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,6BAA6B,CAC3C,aAAqB,+BAAwB;IAE7C,OAAO,GAAG,UAAU,uBAAuB,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retention policy for publications that reached `COMPLETED`.
|
|
3
|
+
*
|
|
4
|
+
* Under the default `UPDATE` completion mode a delivered publication
|
|
5
|
+
* stays in the table as an audit record, and nothing removes it. That is
|
|
6
|
+
* deliberate, but it means the table grows without bound unless someone
|
|
7
|
+
* purges it. This config puts that purge on a timer.
|
|
8
|
+
*
|
|
9
|
+
* Disabled unless you ask for it: `interval: 0` means the scheduler
|
|
10
|
+
* never schedules its loop, following the same "0 disables" convention
|
|
11
|
+
* as {@link StalenessConfig} and {@link OutboxRetryConfig}. It says so
|
|
12
|
+
* in the log on boot rather than staying quiet, so a half-configured
|
|
13
|
+
* policy is visible instead of silently inert.
|
|
14
|
+
*/
|
|
15
|
+
export interface OutboxCleanupConfig {
|
|
16
|
+
/**
|
|
17
|
+
* How often (ms) a purge pass runs. `0` disables cleanup entirely, in
|
|
18
|
+
* which case retention stays manual through
|
|
19
|
+
* `CompletedEventPublications.purge(...)`.
|
|
20
|
+
*/
|
|
21
|
+
readonly interval: number;
|
|
22
|
+
/**
|
|
23
|
+
* How long (ms) a publication is kept after completion. A pass removes
|
|
24
|
+
* only rows whose `completionDate` is older than this.
|
|
25
|
+
*
|
|
26
|
+
* `0` is allowed and means "no grace period": everything already
|
|
27
|
+
* `COMPLETED` at the moment of the pass is eligible. That is a
|
|
28
|
+
* reasonable choice when the row carries no audit value, and a poor
|
|
29
|
+
* one when it does, so it is not the default.
|
|
30
|
+
*/
|
|
31
|
+
readonly retention: number;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum publications removed per pass.
|
|
34
|
+
*
|
|
35
|
+
* The bound is the point. A single unbounded `DELETE` across a mature
|
|
36
|
+
* table is one long transaction holding locks the writers need, and
|
|
37
|
+
* the first pass after enabling cleanup on an existing deployment is
|
|
38
|
+
* exactly when that table is at its largest. Passes are cheap and
|
|
39
|
+
* frequent, so a backlog drains over several of them instead.
|
|
40
|
+
*/
|
|
41
|
+
readonly batchSize: number;
|
|
42
|
+
/**
|
|
43
|
+
* How long (ms) `stop()` waits for an in-flight pass to finish before
|
|
44
|
+
* abandoning it. `0` disables the wait.
|
|
45
|
+
*
|
|
46
|
+
* Abandoning a pass is safe: deletion is per-publication, so an
|
|
47
|
+
* interrupted pass leaves the rows it had not reached yet, and the
|
|
48
|
+
* next pass picks them up.
|
|
49
|
+
*/
|
|
50
|
+
readonly shutdownTimeout: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Cleanup off; every other value is what it would use if switched on.
|
|
54
|
+
* Seven days of retention is a starting point rather than a
|
|
55
|
+
* recommendation: the right window depends on what the audit trail is
|
|
56
|
+
* for in a given deployment.
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_CLEANUP_CONFIG: OutboxCleanupConfig;
|
|
59
|
+
//# sourceMappingURL=cleanup-config.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_CLEANUP_CONFIG = void 0;
|
|
4
|
+
const drain_1 = require("../shutdown/drain");
|
|
5
|
+
/**
|
|
6
|
+
* Cleanup off; every other value is what it would use if switched on.
|
|
7
|
+
* Seven days of retention is a starting point rather than a
|
|
8
|
+
* recommendation: the right window depends on what the audit trail is
|
|
9
|
+
* for in a given deployment.
|
|
10
|
+
*/
|
|
11
|
+
exports.DEFAULT_CLEANUP_CONFIG = {
|
|
12
|
+
interval: 0,
|
|
13
|
+
retention: 7 * 24 * 60 * 60 * 1000,
|
|
14
|
+
batchSize: 500,
|
|
15
|
+
shutdownTimeout: drain_1.DEFAULT_DRAIN_TIMEOUT_MS,
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=cleanup-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup-config.js","sourceRoot":"","sources":["../../src/types/cleanup-config.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAsD7D;;;;;GAKG;AACU,QAAA,sBAAsB,GAAwB;IACzD,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAClC,SAAS,EAAE,GAAG;IACd,eAAe,EAAE,gCAAwB;CAC1C,CAAC"}
|
|
@@ -11,25 +11,21 @@ export type ResubmissionFilter = (publication: EventPublication) => boolean;
|
|
|
11
11
|
* ```ts
|
|
12
12
|
* ResubmissionOptions.defaults()
|
|
13
13
|
* .withBatchSize(50)
|
|
14
|
-
* .withMaxInFlight(5)
|
|
15
14
|
* .withMinAge(10_000)
|
|
16
15
|
* .withMaxAttempts(3);
|
|
17
16
|
* ```
|
|
18
17
|
*/
|
|
19
18
|
export declare class ResubmissionOptions {
|
|
20
19
|
private _batchSize;
|
|
21
|
-
private _maxInFlight;
|
|
22
20
|
private _minAge;
|
|
23
21
|
private _maxCompletionAttempts;
|
|
24
22
|
private _filter;
|
|
25
23
|
static defaults(): ResubmissionOptions;
|
|
26
24
|
withBatchSize(size: number): this;
|
|
27
|
-
withMaxInFlight(n: number): this;
|
|
28
25
|
withMinAge(ms: number): this;
|
|
29
26
|
withMaxAttempts(n: number): this;
|
|
30
27
|
withFilter(filter: ResubmissionFilter): this;
|
|
31
28
|
get batchSize(): number;
|
|
32
|
-
get maxInFlight(): number;
|
|
33
29
|
get minAge(): number;
|
|
34
30
|
get maxCompletionAttempts(): number | null;
|
|
35
31
|
get filter(): ResubmissionFilter | null;
|
|
@@ -8,14 +8,12 @@ exports.ResubmissionOptions = void 0;
|
|
|
8
8
|
* ```ts
|
|
9
9
|
* ResubmissionOptions.defaults()
|
|
10
10
|
* .withBatchSize(50)
|
|
11
|
-
* .withMaxInFlight(5)
|
|
12
11
|
* .withMinAge(10_000)
|
|
13
12
|
* .withMaxAttempts(3);
|
|
14
13
|
* ```
|
|
15
14
|
*/
|
|
16
15
|
class ResubmissionOptions {
|
|
17
16
|
_batchSize = 100;
|
|
18
|
-
_maxInFlight = 10;
|
|
19
17
|
_minAge = 0;
|
|
20
18
|
_maxCompletionAttempts = null;
|
|
21
19
|
_filter = null;
|
|
@@ -26,10 +24,6 @@ class ResubmissionOptions {
|
|
|
26
24
|
this._batchSize = size;
|
|
27
25
|
return this;
|
|
28
26
|
}
|
|
29
|
-
withMaxInFlight(n) {
|
|
30
|
-
this._maxInFlight = n;
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
27
|
withMinAge(ms) {
|
|
34
28
|
this._minAge = ms;
|
|
35
29
|
return this;
|
|
@@ -45,9 +39,6 @@ class ResubmissionOptions {
|
|
|
45
39
|
get batchSize() {
|
|
46
40
|
return this._batchSize;
|
|
47
41
|
}
|
|
48
|
-
get maxInFlight() {
|
|
49
|
-
return this._maxInFlight;
|
|
50
|
-
}
|
|
51
42
|
get minAge() {
|
|
52
43
|
return this._minAge;
|
|
53
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resubmission-options.js","sourceRoot":"","sources":["../../src/types/resubmission-options.ts"],"names":[],"mappings":";;;AAQA
|
|
1
|
+
{"version":3,"file":"resubmission-options.js","sourceRoot":"","sources":["../../src/types/resubmission-options.ts"],"names":[],"mappings":";;;AAQA;;;;;;;;;;GAUG;AACH,MAAa,mBAAmB;IACtB,UAAU,GAAG,GAAG,CAAC;IACjB,OAAO,GAAG,CAAC,CAAC;IACZ,sBAAsB,GAAkB,IAAI,CAAC;IAC7C,OAAO,GAA8B,IAAI,CAAC;IAElD,MAAM,CAAC,QAAQ;QACb,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACnC,CAAC;IAED,aAAa,CAAC,IAAY;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,EAAU;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,eAAe,CAAC,CAAS;QACvB,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,MAA0B;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AA7CD,kDA6CC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy for automatically resubmitting `FAILED` publications
|
|
3
|
+
* (see DD-026).
|
|
4
|
+
*
|
|
5
|
+
* Disabled unless you ask for it: `maxAttempts: 0` means no automatic
|
|
6
|
+
* retry and the scheduler never even schedules its timer, following the
|
|
7
|
+
* same "0 disables" convention as `StalenessConfig`. Recovery then stays
|
|
8
|
+
* what it has always been — an operator (or your own scheduled job)
|
|
9
|
+
* calling `FailedEventPublications.resubmit(...)`.
|
|
10
|
+
*/
|
|
11
|
+
export interface OutboxRetryConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Total attempts a publication gets, counting the first one. `3` means
|
|
14
|
+
* the original delivery plus two automatic retries. `0` disables
|
|
15
|
+
* automatic retry entirely; `1` enables the scheduler but retries
|
|
16
|
+
* nothing, since a `FAILED` publication has already used its single
|
|
17
|
+
* attempt.
|
|
18
|
+
*
|
|
19
|
+
* A publication that exhausts its attempts stays `FAILED` — no
|
|
20
|
+
* separate terminal state (DD-026). It remains visible through
|
|
21
|
+
* `FailedEventPublications.findAll(...)` and an operator can still
|
|
22
|
+
* resubmit it by hand; the cap bounds the automatic path only.
|
|
23
|
+
*/
|
|
24
|
+
readonly maxAttempts: number;
|
|
25
|
+
/** How often (ms) the scheduler looks for retry-eligible publications. */
|
|
26
|
+
readonly interval: number;
|
|
27
|
+
/** Delay (ms) before the first retry. */
|
|
28
|
+
readonly baseDelay: number;
|
|
29
|
+
/** Multiplier applied per attempt: `baseDelay * factor^(attempts - 1)`. */
|
|
30
|
+
readonly factor: number;
|
|
31
|
+
/** Ceiling (ms) for the computed delay, so the curve cannot run away. */
|
|
32
|
+
readonly maxDelay: number;
|
|
33
|
+
/**
|
|
34
|
+
* Fraction of the computed delay (`0`–`1`) to spread retries over.
|
|
35
|
+
* `0.2` shortens or lengthens each publication's window by up to 20%
|
|
36
|
+
* at random, so a mass failure does not produce a synchronised retry
|
|
37
|
+
* burst once the downstream recovers. `0` makes eligibility exactly
|
|
38
|
+
* reproducible.
|
|
39
|
+
*/
|
|
40
|
+
readonly jitter: number;
|
|
41
|
+
/** Maximum publications resubmitted per pass. */
|
|
42
|
+
readonly batchSize: number;
|
|
43
|
+
/**
|
|
44
|
+
* How long (ms) `stop()` waits for an in-flight pass to finish before
|
|
45
|
+
* abandoning it. `0` disables the wait.
|
|
46
|
+
*/
|
|
47
|
+
readonly shutdownTimeout: number;
|
|
48
|
+
}
|
|
49
|
+
/** Automatic retry off; every other value is the curve it would use if switched on. */
|
|
50
|
+
export declare const DEFAULT_RETRY_CONFIG: OutboxRetryConfig;
|
|
51
|
+
//# sourceMappingURL=retry-config.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_RETRY_CONFIG = void 0;
|
|
4
|
+
const drain_1 = require("../shutdown/drain");
|
|
5
|
+
/** Automatic retry off; every other value is the curve it would use if switched on. */
|
|
6
|
+
exports.DEFAULT_RETRY_CONFIG = {
|
|
7
|
+
maxAttempts: 0,
|
|
8
|
+
interval: 60_000,
|
|
9
|
+
baseDelay: 1_000,
|
|
10
|
+
factor: 2,
|
|
11
|
+
maxDelay: 300_000,
|
|
12
|
+
jitter: 0.2,
|
|
13
|
+
batchSize: 100,
|
|
14
|
+
shutdownTimeout: drain_1.DEFAULT_DRAIN_TIMEOUT_MS,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=retry-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-config.js","sourceRoot":"","sources":["../../src/types/retry-config.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAmD7D,uFAAuF;AAC1E,QAAA,oBAAoB,GAAsB;IACrD,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,GAAG;IACX,SAAS,EAAE,GAAG;IACd,eAAe,EAAE,gCAAwB;CAC1C,CAAC"}
|
|
@@ -13,6 +13,14 @@ export interface StalenessConfig {
|
|
|
13
13
|
readonly resubmitted: number;
|
|
14
14
|
/** How often (ms) the staleness monitor runs. Defaults to 60000 (1 minute). */
|
|
15
15
|
readonly monitorInterval: number;
|
|
16
|
+
/**
|
|
17
|
+
* How long (ms) `stop()` waits for an in-flight staleness sweep to
|
|
18
|
+
* finish before abandoning it. A sweep is framework-controlled
|
|
19
|
+
* database work rather than user code, so it normally completes well
|
|
20
|
+
* inside the budget; the bound exists so a hung query cannot stall
|
|
21
|
+
* shutdown. `0` disables the wait entirely.
|
|
22
|
+
*/
|
|
23
|
+
readonly shutdownTimeout: number;
|
|
16
24
|
}
|
|
17
25
|
export declare const DEFAULT_STALENESS_CONFIG: StalenessConfig;
|
|
18
26
|
//# sourceMappingURL=staleness-config.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_STALENESS_CONFIG = void 0;
|
|
4
|
+
const drain_1 = require("../shutdown/drain");
|
|
4
5
|
exports.DEFAULT_STALENESS_CONFIG = {
|
|
5
6
|
published: 0,
|
|
6
7
|
processing: 0,
|
|
7
8
|
resubmitted: 0,
|
|
8
9
|
monitorInterval: 60_000,
|
|
10
|
+
shutdownTimeout: drain_1.DEFAULT_DRAIN_TIMEOUT_MS,
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=staleness-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staleness-config.js","sourceRoot":"","sources":["../../src/types/staleness-config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"staleness-config.js","sourceRoot":"","sources":["../../src/types/staleness-config.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AA2BhD,QAAA,wBAAwB,GAAoB;IACvD,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,gCAAwB;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-transactional/outbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Persistent Event Publication Registry for @nestjs-transactional — Spring Modulith equivalent (ORM-agnostic core)",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"sideEffects": false,
|
|
6
8
|
"author": "Igor Golovanov",
|
|
7
9
|
"repository": {
|
|
8
10
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/igorgolovanov/nestjs-transactional.git",
|
|
11
|
+
"url": "git+https://github.com/igorgolovanov/nestjs-transactional.git",
|
|
10
12
|
"directory": "packages/outbox"
|
|
11
13
|
},
|
|
12
14
|
"bugs": {
|
|
@@ -42,9 +44,15 @@
|
|
|
42
44
|
"default": "./dist/testing/index.js"
|
|
43
45
|
}
|
|
44
46
|
},
|
|
47
|
+
"typesVersions": {
|
|
48
|
+
"*": {
|
|
49
|
+
"testing": [
|
|
50
|
+
"./dist/testing/index.d.ts"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
45
54
|
"publishConfig": {
|
|
46
55
|
"access": "public",
|
|
47
|
-
"tag": "alpha",
|
|
48
56
|
"provenance": true
|
|
49
57
|
},
|
|
50
58
|
"peerDependencies": {
|
|
@@ -52,19 +60,20 @@
|
|
|
52
60
|
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
53
61
|
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
54
62
|
"rxjs": "^7.0.0",
|
|
55
|
-
"@nestjs-transactional/core": "^1.0.0
|
|
63
|
+
"@nestjs-transactional/core": "^1.0.0"
|
|
56
64
|
},
|
|
57
65
|
"devDependencies": {
|
|
58
|
-
"@nestjs/common": "^11.
|
|
59
|
-
"@nestjs/core": "^11.
|
|
60
|
-
"@nestjs/testing": "^11.
|
|
61
|
-
"@types/jest": "^
|
|
62
|
-
"
|
|
66
|
+
"@nestjs/common": "^11.2.3",
|
|
67
|
+
"@nestjs/core": "^11.2.3",
|
|
68
|
+
"@nestjs/testing": "^11.2.3",
|
|
69
|
+
"@types/jest": "^30.0.0",
|
|
70
|
+
"@types/node": "^22.20.1",
|
|
71
|
+
"jest": "^30.4.2",
|
|
63
72
|
"reflect-metadata": "^0.2.2",
|
|
64
73
|
"rxjs": "^7.8.1",
|
|
65
|
-
"ts-jest": "^29.
|
|
66
|
-
"typescript": "^
|
|
67
|
-
"@nestjs-transactional/core": "1.0.0
|
|
74
|
+
"ts-jest": "^29.4.12",
|
|
75
|
+
"typescript": "^6.0.3",
|
|
76
|
+
"@nestjs-transactional/core": "1.0.0"
|
|
68
77
|
},
|
|
69
78
|
"scripts": {
|
|
70
79
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -73,6 +82,9 @@
|
|
|
73
82
|
"test:watch": "jest --watch",
|
|
74
83
|
"test:cov": "jest --coverage",
|
|
75
84
|
"type-check": "tsc --noEmit",
|
|
76
|
-
"lint": "eslint
|
|
85
|
+
"lint": "eslint .",
|
|
86
|
+
"api:check": "api-extractor run && api-extractor run -c api-extractor.testing.json",
|
|
87
|
+
"api:update": "api-extractor run --local && api-extractor run --local -c api-extractor.testing.json",
|
|
88
|
+
"publish:check": "publint && attw --pack ."
|
|
77
89
|
}
|
|
78
90
|
}
|