@spinajs/queue-sqs-transport 2.0.482 → 2.0.485
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/lib/cjs/connection-factory.d.ts +2 -0
- package/lib/cjs/connection-factory.d.ts.map +1 -0
- package/lib/cjs/connection-factory.js +24 -0
- package/lib/cjs/connection-factory.js.map +1 -0
- package/lib/cjs/connection.d.ts +99 -0
- package/lib/cjs/connection.d.ts.map +1 -0
- package/lib/cjs/connection.js +264 -0
- package/lib/cjs/connection.js.map +1 -0
- package/lib/cjs/index.d.ts +3 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +19 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +1 -0
- package/lib/mjs/connection-factory.d.ts +2 -0
- package/lib/mjs/connection-factory.d.ts.map +1 -0
- package/lib/mjs/connection-factory.js +22 -0
- package/lib/mjs/connection-factory.js.map +1 -0
- package/lib/mjs/connection.d.ts +99 -0
- package/lib/mjs/connection.d.ts.map +1 -0
- package/lib/mjs/connection.js +258 -0
- package/lib/mjs/connection.js.map +1 -0
- package/lib/mjs/index.d.ts +3 -0
- package/lib/mjs/index.d.ts.map +1 -0
- package/lib/mjs/index.js +3 -0
- package/lib/mjs/index.js.map +1 -0
- package/lib/mjs/package.json +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/lib/tsconfig.mjs.tsbuildinfo +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { QueueClient } from '@spinajs/queue';
|
|
11
|
+
import { Injectable, PerInstanceCheck } from '@spinajs/di';
|
|
12
|
+
import { SQSClient, SendMessageCommand, ReceiveMessageCommand, DeleteMessageCommand } from '@aws-sdk/client-sqs';
|
|
13
|
+
import { DateTime } from 'luxon';
|
|
14
|
+
import _ from 'lodash';
|
|
15
|
+
let SqsQueueClient = class SqsQueueClient extends QueueClient {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super(options);
|
|
18
|
+
/**
|
|
19
|
+
* Active subscriptions keyed by queue URL. Each entry owns a detached poll loop.
|
|
20
|
+
*/
|
|
21
|
+
this.Subscriptions = new Map();
|
|
22
|
+
}
|
|
23
|
+
async resolve() {
|
|
24
|
+
const o = (this.Options.options ?? {});
|
|
25
|
+
// SQS is HTTP based - there is no eager connection to establish and no
|
|
26
|
+
// connection-level destination to validate here. Destinations are resolved
|
|
27
|
+
// per-message at emit time via getChannelForMessage, which consults the
|
|
28
|
+
// global queue.routing table first and only then falls back to the
|
|
29
|
+
// connection defaults - so a routing-only connection ( no defaultQueueChannel /
|
|
30
|
+
// defaultTopicChannel ) is perfectly valid. resolve()'s only job is to build
|
|
31
|
+
// the SQSClient; region/endpoint/credentials are all optional for the SDK.
|
|
32
|
+
this.Sqs = new SQSClient({
|
|
33
|
+
region: o.region,
|
|
34
|
+
endpoint: o.endpoint,
|
|
35
|
+
credentials: o.credentials,
|
|
36
|
+
});
|
|
37
|
+
this.Log.info(`SQS queue client ${this.Options.name} resolved ( region: ${o.region ?? '<default>'}, endpoint: ${o.endpoint ?? '<default>'} )`);
|
|
38
|
+
}
|
|
39
|
+
async emit(message) {
|
|
40
|
+
// routing[message.Name] || defaultQueueChannel|defaultTopicChannel - for SQS
|
|
41
|
+
// these entries are queue URLs. `Name`/`Type`/`JobId` ride the JSON body so
|
|
42
|
+
// the core consumer can rehydrate the message on the receiving side.
|
|
43
|
+
const urls = this.getChannelForMessage(message);
|
|
44
|
+
const body = JSON.stringify(message);
|
|
45
|
+
await Promise.all(urls.map((QueueUrl) => {
|
|
46
|
+
this.Log.trace(`Publishing ${message.Type} Name: ${message.Name} to SQS queue ${QueueUrl} ( ${this.Options.name} )`);
|
|
47
|
+
return this.Sqs.send(new SendMessageCommand({ QueueUrl, MessageBody: body }));
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
async subscribe(channelOrMessage, callback, _subscriptionId, _durable) {
|
|
51
|
+
// mirror STOMP's overload handling: a raw string is the queue URL itself,
|
|
52
|
+
// a message class is resolved through the routing table.
|
|
53
|
+
const urls = _.isString(channelOrMessage) ? [channelOrMessage] : this.getChannelForMessage(channelOrMessage);
|
|
54
|
+
urls.forEach((url) => {
|
|
55
|
+
if (this.Subscriptions.has(url)) {
|
|
56
|
+
this.Log.warn(`SQS queue ${url} already subscribed !`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const desc = {
|
|
60
|
+
url,
|
|
61
|
+
callback,
|
|
62
|
+
running: true,
|
|
63
|
+
controller: new AbortController(),
|
|
64
|
+
exited: false,
|
|
65
|
+
};
|
|
66
|
+
this.Subscriptions.set(url, desc);
|
|
67
|
+
// detached loop - subscribe returns as soon as the poll loop is started,
|
|
68
|
+
// it is NOT awaited. Errors inside the loop must never escape ( there is no
|
|
69
|
+
// caller to catch them ), so pollLoop swallows/logs everything itself.
|
|
70
|
+
void this.pollLoop(desc);
|
|
71
|
+
this.Log.success(`SQS queue ${url} subscribed and polling for messages !`);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Long-poll loop for a single subscription. Runs until `desc.running` is cleared
|
|
76
|
+
* ( by unsubscribe / dispose ). On success the message is acked by DeleteMessage;
|
|
77
|
+
* on handler failure the message is left untouched so the SQS visibility timeout
|
|
78
|
+
* redelivers it and the redrive policy dead-letters after maxReceiveCount.
|
|
79
|
+
*/
|
|
80
|
+
async pollLoop(desc) {
|
|
81
|
+
const o = (this.Options.options ?? {});
|
|
82
|
+
// Escalating backoff for the receive-error branch. Starts at the base delay,
|
|
83
|
+
// doubles on each consecutive failure up to the cap, and is reset to the base
|
|
84
|
+
// after any successful ReceiveMessage. Without this a persistent fault
|
|
85
|
+
// ( deleted queue, revoked credentials, permanently dead endpoint ) makes the
|
|
86
|
+
// SDK send throw immediately and the loop spins as a tight infinite loop,
|
|
87
|
+
// spamming logs and hammering the SQS API.
|
|
88
|
+
const baseBackoff = Math.max(0, o.receiveErrorBackoffMs ?? 500);
|
|
89
|
+
const maxBackoff = Math.max(baseBackoff, o.receiveErrorBackoffMaxMs ?? 10000);
|
|
90
|
+
let backoff = baseBackoff;
|
|
91
|
+
try {
|
|
92
|
+
while (desc.running) {
|
|
93
|
+
let res;
|
|
94
|
+
try {
|
|
95
|
+
res = await this.Sqs.send(new ReceiveMessageCommand({
|
|
96
|
+
QueueUrl: desc.url,
|
|
97
|
+
WaitTimeSeconds: o.waitTimeSeconds ?? 20,
|
|
98
|
+
MaxNumberOfMessages: o.maxMessages ?? 1,
|
|
99
|
+
VisibilityTimeout: o.visibilityTimeout,
|
|
100
|
+
}), { abortSignal: desc.controller.signal });
|
|
101
|
+
// a successful receive clears the fault - drop back to the base delay so a
|
|
102
|
+
// transient blip doesn't leave the loop permanently slow.
|
|
103
|
+
backoff = baseBackoff;
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
// aborted by unsubscribe / dispose - the in-flight long poll was cut short
|
|
107
|
+
if (!desc.running) {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
// receive error ( throttling, network blip, or a persistent fault ) - log
|
|
111
|
+
// and keep the loop alive, otherwise a single hiccup would silently stop
|
|
112
|
+
// consumption. Back off before retrying so a *persistent* fault can't
|
|
113
|
+
// hot-loop the receive; the sleep is abortable so unsubscribe / dispose
|
|
114
|
+
// still tears the loop down promptly instead of waiting out the delay.
|
|
115
|
+
this.Log.warn(`SQS receive error on ${desc.url} ( ${this.Options.name} ), backing off ${backoff}ms: ${err}`);
|
|
116
|
+
await this.backoffSleep(backoff, desc.controller.signal);
|
|
117
|
+
backoff = Math.min(backoff * 2, maxBackoff);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
for (const m of res?.Messages ?? []) {
|
|
121
|
+
// a concurrent unsubscribe / dispose may have flipped this mid-batch
|
|
122
|
+
if (!desc.running) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
// Defense-in-depth: NOTHING a single message does may escape this loop as
|
|
126
|
+
// an unhandled rejection ( the loop runs detached - there is no caller to
|
|
127
|
+
// catch it, and an escaped throw would crash the worker / Node process ).
|
|
128
|
+
// Any per-message failure is logged and the loop moves on.
|
|
129
|
+
try {
|
|
130
|
+
await this.handleMessage(desc, m);
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
this.Log.error(`Unexpected error handling SQS message on ${desc.url} ( ${this.Options.name} ), skipping: ${err}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
// last-resort guard: even the loop scaffolding ( e.g. an unexpected throw from
|
|
140
|
+
// the receive-error branch ) must not reject the detached promise.
|
|
141
|
+
this.Log.error(`SQS poll loop for ${desc.url} ( ${this.Options.name} ) crashed unexpectedly: ${err}`);
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
desc.exited = true;
|
|
145
|
+
this.Log.trace(`SQS poll loop for ${desc.url} ( ${this.Options.name} ) stopped`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Processes a single received SQS message: parse -> rehydrate -> handler -> ack.
|
|
150
|
+
* Guards against poison / non-object payloads so a bad message is skipped rather
|
|
151
|
+
* than crashing the loop. Keeps the ack/nack contract: delete on handler success,
|
|
152
|
+
* leave ( for redelivery / DLQ ) on handler failure.
|
|
153
|
+
*/
|
|
154
|
+
async handleMessage(desc, m) {
|
|
155
|
+
let parsed;
|
|
156
|
+
try {
|
|
157
|
+
parsed = JSON.parse(m.Body);
|
|
158
|
+
}
|
|
159
|
+
catch (e) {
|
|
160
|
+
// poison message - we can't tell its Type so we can't route it. Leave it:
|
|
161
|
+
// SQS redelivery + the redrive policy will dead-letter it after maxReceiveCount,
|
|
162
|
+
// which is preferable to deleting evidence of a producer bug.
|
|
163
|
+
this.Log.error(`Unparseable SQS message on ${desc.url} ( ${this.Options.name} ), leaving for redelivery / DLQ: ${e}`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
// JSON.parse happily yields non-object values ( null, numbers, strings,
|
|
167
|
+
// booleans ) that would blow up the CreatedAt / callback access below with a
|
|
168
|
+
// TypeError. Treat them as poison and skip so the loop stays alive.
|
|
169
|
+
if (!parsed || typeof parsed !== 'object') {
|
|
170
|
+
this.Log.error(`Non-object SQS message body on ${desc.url} ( ${this.Options.name} ), skipping`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const message = parsed;
|
|
174
|
+
// luxon DateTime serializes to an ISO string over the wire - rehydrate it
|
|
175
|
+
if (typeof message.CreatedAt === 'string') {
|
|
176
|
+
message.CreatedAt = DateTime.fromISO(message.CreatedAt);
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
await desc.callback(message);
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
// NACK: do nothing. The message stays invisible only for the visibility
|
|
183
|
+
// timeout, after which SQS redelivers; the redrive policy dead-letters it
|
|
184
|
+
// once maxReceiveCount is hit. No manual retry / DLQ logic here.
|
|
185
|
+
this.Log.error(`Handler failed for ${message.Name} on ${desc.url}, leaving message for redelivery: ${err}`);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
// ACK: only delete once the handler has fully succeeded. A delete failure is
|
|
189
|
+
// non-fatal ( at-least-once: SQS will simply redeliver ) and is logged
|
|
190
|
+
// distinctly so it is never mistaken for a handler failure.
|
|
191
|
+
try {
|
|
192
|
+
await this.Sqs.send(new DeleteMessageCommand({ QueueUrl: desc.url, ReceiptHandle: m.ReceiptHandle }));
|
|
193
|
+
this.Log.trace(`Processed and acked ${message.Type} Name: ${message.Name} from ${desc.url} ( ${this.Options.name} )`);
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
this.Log.error(`ack/delete failed for message ${message.Name} on ${desc.url} ( ${this.Options.name} ), it will redeliver: ${err}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
unsubscribe(channelOrMessage, _removeDurable) {
|
|
200
|
+
const urls = _.isString(channelOrMessage) ? [channelOrMessage] : this.getChannelForMessage(channelOrMessage);
|
|
201
|
+
urls.forEach((url) => {
|
|
202
|
+
const desc = this.Subscriptions.get(url);
|
|
203
|
+
if (!desc) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
this.stop(desc);
|
|
207
|
+
this.Subscriptions.delete(url);
|
|
208
|
+
this.Log.info(`Unsubscribed from SQS queue ${url} ( ${this.Options.name} )`);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
async dispose() {
|
|
212
|
+
// stop every poll loop and interrupt any in-flight long poll so this returns
|
|
213
|
+
// promptly instead of waiting up to WaitTimeSeconds for the last receive.
|
|
214
|
+
for (const desc of this.Subscriptions.values()) {
|
|
215
|
+
this.stop(desc);
|
|
216
|
+
}
|
|
217
|
+
this.Subscriptions.clear();
|
|
218
|
+
this.Sqs?.destroy();
|
|
219
|
+
this.Log.info(`SQS queue client ${this.Options.name} disposed`);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Abortable delay used by the receive-error backoff. Resolves after `ms`, or
|
|
223
|
+
* immediately if the descriptor's AbortController fires ( unsubscribe / dispose )
|
|
224
|
+
* so a disposed subscription never sits parked in a long backoff sleep. The
|
|
225
|
+
* loop re-checks `desc.running` right after, so an abort mid-sleep exits promptly.
|
|
226
|
+
*/
|
|
227
|
+
backoffSleep(ms, signal) {
|
|
228
|
+
if (ms <= 0 || signal.aborted) {
|
|
229
|
+
return Promise.resolve();
|
|
230
|
+
}
|
|
231
|
+
return new Promise((resolve) => {
|
|
232
|
+
const onAbort = () => {
|
|
233
|
+
clearTimeout(timer);
|
|
234
|
+
resolve();
|
|
235
|
+
};
|
|
236
|
+
const timer = setTimeout(() => {
|
|
237
|
+
signal.removeEventListener('abort', onAbort);
|
|
238
|
+
resolve();
|
|
239
|
+
}, ms);
|
|
240
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Stops a subscription's poll loop: clears the running flag and aborts any
|
|
245
|
+
* in-flight ReceiveMessage. The loop observes both and exits.
|
|
246
|
+
*/
|
|
247
|
+
stop(desc) {
|
|
248
|
+
desc.running = false;
|
|
249
|
+
desc.controller.abort();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
SqsQueueClient = __decorate([
|
|
253
|
+
PerInstanceCheck(),
|
|
254
|
+
Injectable(QueueClient),
|
|
255
|
+
__metadata("design:paramtypes", [Object])
|
|
256
|
+
], SqsQueueClient);
|
|
257
|
+
export { SqsQueueClient };
|
|
258
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAA0C,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAe,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM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CAAC;CACF,CAAA;AA1RY,cAAc;IAF1B,gBAAgB,EAAE;IAClB,UAAU,CAAC,WAAW,CAAC;;GACX,cAAc,CA0R1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|
package/lib/mjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|