@spinajs/queue-stomp-transport 2.0.481 → 2.0.484
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.js +6 -2
- package/lib/cjs/connection-factory.js.map +1 -1
- package/lib/cjs/connection.d.ts +101 -2
- package/lib/cjs/connection.d.ts.map +1 -1
- package/lib/cjs/connection.js +409 -87
- package/lib/cjs/connection.js.map +1 -1
- package/lib/cjs/index.d.ts +2 -2
- package/lib/mjs/connection-factory.js +6 -2
- package/lib/mjs/connection-factory.js.map +1 -1
- package/lib/mjs/connection.d.ts +101 -2
- package/lib/mjs/connection.d.ts.map +1 -1
- package/lib/mjs/connection.js +411 -89
- package/lib/mjs/connection.js.map +1 -1
- package/lib/mjs/index.d.ts +2 -2
- package/lib/mjs/index.js +2 -2
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +16 -16
package/lib/mjs/connection.js
CHANGED
|
@@ -8,90 +8,409 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { UnexpectedServerError, InvalidArgument } from '@spinajs/exceptions';
|
|
11
|
-
import { QueueClient } from '@spinajs/queue';
|
|
11
|
+
import { QueueClient, QueueMessageType } from '@spinajs/queue';
|
|
12
12
|
import Stomp from '@stomp/stompjs';
|
|
13
13
|
import _ from 'lodash';
|
|
14
|
-
import { Injectable, PerInstanceCheck } from '@spinajs/di';
|
|
14
|
+
import { DI, Injectable, PerInstanceCheck } from '@spinajs/di';
|
|
15
|
+
import { BackoffType, ResiliencePipelineBuilder } from '@spinajs/util';
|
|
15
16
|
import websocket from 'websocket';
|
|
17
|
+
import { randomUUID } from 'crypto';
|
|
18
|
+
import { DateTime } from 'luxon';
|
|
16
19
|
Object.assign(global, { WebSocket: websocket.w3cwebsocket });
|
|
20
|
+
/**
|
|
21
|
+
* Default time to wait for a broker RECEIPT frame when publishing a message
|
|
22
|
+
* before the emit is considered failed. Can be overridden via `Options.receiptTimeout`.
|
|
23
|
+
*/
|
|
24
|
+
const DEFAULT_RECEIPT_TIMEOUT_MS = 5000;
|
|
25
|
+
/**
|
|
26
|
+
* Time to wait for the initial STOMP connection before giving up.
|
|
27
|
+
* Can be overridden via `Options.connectionTimeout`.
|
|
28
|
+
*/
|
|
29
|
+
const DEFAULT_CONNECTION_TIMEOUT_MS = 10000;
|
|
30
|
+
/**
|
|
31
|
+
* Default reconnect / heartbeat timings used when not provided in connection options.
|
|
32
|
+
*
|
|
33
|
+
* NOTE on heartbeats: the default ( 4s ) suits brokers that support STOMP heartbeats over
|
|
34
|
+
* WebSocket ( eg. ActiveMQ ). RabbitMQ Web-STOMP / SockJS does NOT support heartbeats - when
|
|
35
|
+
* targeting it, set `heartbeatIncoming` and `heartbeatOutgoing` to 0 in the connection options,
|
|
36
|
+
* otherwise the connection will be dropped. We keep 4s as the default so dead-connection
|
|
37
|
+
* detection still works on brokers that do support it.
|
|
38
|
+
*/
|
|
39
|
+
const DEFAULT_RECONNECT_DELAY_MS = 5000;
|
|
40
|
+
const DEFAULT_HEARTBEAT_MS = 4000;
|
|
41
|
+
/**
|
|
42
|
+
* STOMP header carrying the number of times a job has already been retried.
|
|
43
|
+
* Set by this transport when it reschedules a failed job.
|
|
44
|
+
*/
|
|
45
|
+
const RETRY_COUNT_HEADER = 'x-retry-count';
|
|
17
46
|
let StompQueueClient = class StompQueueClient extends QueueClient {
|
|
18
47
|
get ClientId() {
|
|
19
48
|
return this.Options.clientId ?? this.Options.name;
|
|
20
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* `true` when there is an active connection with the broker.
|
|
52
|
+
*/
|
|
53
|
+
get Connected() {
|
|
54
|
+
return this.Client?.connected ?? false;
|
|
55
|
+
}
|
|
56
|
+
get ReceiptTimeout() {
|
|
57
|
+
return this.Options.receiptTimeout ?? this.Options.options?.receiptTimeout ?? DEFAULT_RECEIPT_TIMEOUT_MS;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolves once the client is connected. If already connected resolves immediately,
|
|
61
|
+
* otherwise waits for the next ( re )connect, optionally bounded by `timeoutMs`.
|
|
62
|
+
*/
|
|
63
|
+
whenReady(timeoutMs) {
|
|
64
|
+
if (this.Connected) {
|
|
65
|
+
return Promise.resolve();
|
|
66
|
+
}
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
let timer;
|
|
69
|
+
const waiter = () => {
|
|
70
|
+
if (timer) {
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
}
|
|
73
|
+
resolve();
|
|
74
|
+
};
|
|
75
|
+
if (timeoutMs) {
|
|
76
|
+
timer = setTimeout(() => {
|
|
77
|
+
this.ReadyWaiters = this.ReadyWaiters.filter((w) => w !== waiter);
|
|
78
|
+
reject(new UnexpectedServerError(`Timeout waiting for queue connection ${this.Options.name} to become ready`));
|
|
79
|
+
}, timeoutMs);
|
|
80
|
+
}
|
|
81
|
+
this.ReadyWaiters.push(waiter);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
21
84
|
constructor(options) {
|
|
22
85
|
super(options);
|
|
23
86
|
this.Subscriptions = new Map();
|
|
87
|
+
this.PendingEmits = [];
|
|
88
|
+
// resolvers waiting for the connection to come up ( see whenReady )
|
|
89
|
+
this.ReadyWaiters = [];
|
|
90
|
+
this.Disposing = false;
|
|
91
|
+
/** Publisher-side resilience: retry each receipt-confirmed publish with backoff so a transient
|
|
92
|
+
* broker hiccup / receipt timeout doesn't fail the emit. Duplicates are handled by consumer dedup. */
|
|
93
|
+
this.EmitPipeline = this.buildEmitPipeline();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Creates the underlying stompjs client. Extracted so it can be overridden
|
|
97
|
+
* ( e.g. with a fake ) in unit tests without a live broker.
|
|
98
|
+
*/
|
|
99
|
+
createClient(config) {
|
|
100
|
+
return new Stomp.Client(config);
|
|
24
101
|
}
|
|
25
102
|
async resolve() {
|
|
26
103
|
this.Log.info(`Connecting to STOMP queue at ${this.Options.host} with client-id: ${this.ClientId} ...`);
|
|
27
|
-
this.Client =
|
|
104
|
+
this.Client = this.createClient({
|
|
28
105
|
brokerURL: this.Options.host,
|
|
29
106
|
connectHeaders: {
|
|
30
107
|
login: this.Options.login,
|
|
31
108
|
passcode: this.Options.password,
|
|
32
109
|
'client-id': this.ClientId,
|
|
33
110
|
},
|
|
34
|
-
reconnectDelay:
|
|
35
|
-
heartbeatIncoming:
|
|
36
|
-
heartbeatOutgoing:
|
|
37
|
-
|
|
111
|
+
reconnectDelay: this.Options.reconnectDelay ?? DEFAULT_RECONNECT_DELAY_MS,
|
|
112
|
+
heartbeatIncoming: this.Options.heartbeatIncoming ?? DEFAULT_HEARTBEAT_MS,
|
|
113
|
+
heartbeatOutgoing: this.Options.heartbeatOutgoing ?? DEFAULT_HEARTBEAT_MS,
|
|
114
|
+
connectionTimeout: this.Options.connectionTimeout ?? DEFAULT_CONNECTION_TIMEOUT_MS,
|
|
115
|
+
// additional options ( may override any of the defaults above )
|
|
38
116
|
...this.Options.options,
|
|
39
117
|
});
|
|
40
118
|
this.Client.debug = (str) => {
|
|
41
119
|
this.Log.trace(`${str}, Client-id: ${this.ClientId}, name: ${this.Options.name}`);
|
|
42
120
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
121
|
+
// if a credential provider is configured, refresh credentials right before
|
|
122
|
+
// every ( re )connect - supports rotating secrets / token based auth
|
|
123
|
+
if (this.Options.credentialProvider) {
|
|
124
|
+
this.Client.beforeConnect = async () => {
|
|
125
|
+
const provider = DI.resolve(this.Options.credentialProvider);
|
|
126
|
+
const creds = await provider.getCredentials(this.Options);
|
|
127
|
+
this.Client.connectHeaders = {
|
|
128
|
+
'client-id': this.ClientId,
|
|
129
|
+
...(creds.login ? { login: creds.login } : {}),
|
|
130
|
+
...(creds.passcode ? { passcode: creds.passcode } : {}),
|
|
131
|
+
};
|
|
46
132
|
};
|
|
133
|
+
}
|
|
134
|
+
// lifecycle handlers that simply log - installed once, never reassigned
|
|
135
|
+
this.Client.onUnhandledMessage = (message) => {
|
|
136
|
+
this.Log.warn(`Received unhandled message on ${message.headers?.destination ?? '<unknown>'} ( ${this.Options.name} ): ${message.body}`);
|
|
137
|
+
};
|
|
138
|
+
this.Client.onDisconnect = () => {
|
|
139
|
+
this.Log.warn(`Disconnected from STOMP client, client-id: ${this.ClientId}`);
|
|
140
|
+
};
|
|
141
|
+
this.Client.onWebSocketClose = () => {
|
|
142
|
+
this.Log.warn(`STOMP websocket closed, client-id: ${this.ClientId} ( will auto-reconnect if active )`);
|
|
143
|
+
};
|
|
144
|
+
return new Promise((resolve, reject) => {
|
|
145
|
+
// ensures we settle the initial-connect promise exactly once, and that a
|
|
146
|
+
// broker / websocket error only rejects BEFORE the first successful connect
|
|
147
|
+
let settled = false;
|
|
148
|
+
// onConnect fires on EVERY ( re )connect - this is where we replay
|
|
149
|
+
// subscriptions and flush buffered emits so the client survives drops
|
|
47
150
|
this.Client.onConnect = () => {
|
|
48
151
|
this.Log.success('Connected to STOMP client, client-id: ' + this.ClientId);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
|
|
152
|
+
for (const desc of this.Subscriptions.values()) {
|
|
153
|
+
this.applySubscription(desc);
|
|
154
|
+
}
|
|
155
|
+
this.flushPendingEmits();
|
|
156
|
+
this.flushReadyWaiters();
|
|
157
|
+
if (!settled) {
|
|
158
|
+
settled = true;
|
|
159
|
+
resolve();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
this.Client.onStompError = (frame) => {
|
|
163
|
+
// Compliant brokers terminate the connection after an ERROR frame.
|
|
164
|
+
// Bad login / passcode typically surfaces here.
|
|
165
|
+
this.Log.error('Broker reported error: ' + frame.headers['message']);
|
|
166
|
+
this.Log.error('Additional details: ' + frame.body);
|
|
167
|
+
if (!settled) {
|
|
168
|
+
settled = true;
|
|
169
|
+
this.Client.deactivate();
|
|
170
|
+
reject(new UnexpectedServerError(`Cannot connect to queue server at ${this.Options.host}`, frame));
|
|
171
|
+
}
|
|
68
172
|
};
|
|
69
173
|
this.Client.onWebSocketError = (err) => {
|
|
70
|
-
this.Log.error(`Websocket error: ${JSON.stringify(err)}`);
|
|
71
|
-
|
|
174
|
+
this.Log.error(`Websocket error: ${JSON.stringify(err)}, client-id: ${this.ClientId}`);
|
|
175
|
+
if (!settled) {
|
|
176
|
+
settled = true;
|
|
177
|
+
this.Client.deactivate();
|
|
178
|
+
reject(new UnexpectedServerError(`Cannot connect to queue server at ${this.Options.host}, websocket error`, err));
|
|
179
|
+
}
|
|
72
180
|
};
|
|
73
181
|
this.Client.activate();
|
|
74
182
|
});
|
|
75
183
|
}
|
|
76
184
|
async dispose() {
|
|
77
185
|
this.Log.info(`Disposing queue connection ${this.Options.name} ...`);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
186
|
+
this.Disposing = true;
|
|
187
|
+
// fail any still-buffered emits so callers awaiting them don't hang forever
|
|
188
|
+
const pending = this.PendingEmits;
|
|
189
|
+
this.PendingEmits = [];
|
|
190
|
+
for (const p of pending) {
|
|
191
|
+
p.reject(new UnexpectedServerError(`Queue connection ${this.Options.name} disposed before message could be sent`));
|
|
192
|
+
}
|
|
193
|
+
if (!this.Client) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// deactivate() resolves once the underlying websocket is disposed
|
|
197
|
+
await this.Client.deactivate();
|
|
198
|
+
this.Log.success('STOMP client deactivated');
|
|
91
199
|
}
|
|
92
200
|
async emit(message) {
|
|
201
|
+
if (!this.Client?.connected) {
|
|
202
|
+
if (this.Disposing) {
|
|
203
|
+
throw new UnexpectedServerError(`Cannot emit message, queue connection ${this.Options.name} is disposing`);
|
|
204
|
+
}
|
|
205
|
+
// not connected - buffer and flush on next ( re )connect
|
|
206
|
+
return new Promise((resolve, reject) => {
|
|
207
|
+
this.PendingEmits.push({ message, resolve, reject });
|
|
208
|
+
this.Log.warn(`Queue ${this.Options.name} not connected, message ${message.Name} buffered ( ${this.PendingEmits.length} pending )`);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return this.publishMessage(message);
|
|
212
|
+
}
|
|
213
|
+
unsubscribe(channelOrMessage, removeDurable = false) {
|
|
214
|
+
const channels = _.isString(channelOrMessage) ? [channelOrMessage] : this.getChannelForMessage(channelOrMessage);
|
|
215
|
+
channels.forEach((c) => {
|
|
216
|
+
const desc = this.Subscriptions.get(c);
|
|
217
|
+
if (!desc) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (desc.durable && removeDurable && desc.subscriptionId) {
|
|
221
|
+
// delete the broker-side durable subscription, not just stop consuming.
|
|
222
|
+
// ActiveMQ removes a durable sub when UNSUBSCRIBE carries its subscription name.
|
|
223
|
+
this.Client.unsubscribe(desc.subscriptionId, { 'activemq.subscriptionName': desc.subscriptionId });
|
|
224
|
+
this.Log.info(`Removed durable subscription ${desc.subscriptionId} on channel ${c}`);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
desc.active?.unsubscribe();
|
|
228
|
+
}
|
|
229
|
+
this.Subscriptions.delete(c);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async subscribe(channelOrMessage, callback, subscriptionId, durable) {
|
|
233
|
+
const channels = _.isString(channelOrMessage) ? [channelOrMessage] : this.getChannelForMessage(channelOrMessage);
|
|
234
|
+
channels.forEach((c) => {
|
|
235
|
+
if (this.Subscriptions.has(c)) {
|
|
236
|
+
this.Log.warn(`Channel ${c} already subscribed !`);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (durable && !subscriptionId) {
|
|
240
|
+
throw new InvalidArgument(`subscriptionId cannot be empty if using durable subscriptions`);
|
|
241
|
+
}
|
|
242
|
+
const desc = { channel: c, callback, subscriptionId, durable };
|
|
243
|
+
this.Subscriptions.set(c, desc);
|
|
244
|
+
// if already connected subscribe now, otherwise it will be applied on next onConnect
|
|
245
|
+
if (this.Client?.connected) {
|
|
246
|
+
this.applySubscription(desc);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
this.Log.info(`Channel ${c} recorded, will subscribe once connected`);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Creates the live broker subscription for a tracked descriptor.
|
|
255
|
+
* Called on initial subscribe and replayed for every descriptor on reconnect.
|
|
256
|
+
*/
|
|
257
|
+
applySubscription(desc) {
|
|
258
|
+
const headers = { ack: 'client-individual', 'activemq.prefetchSize': '1' };
|
|
259
|
+
if (desc.subscriptionId) {
|
|
260
|
+
headers.id = desc.subscriptionId;
|
|
261
|
+
}
|
|
262
|
+
if (desc.durable) {
|
|
263
|
+
// durable subscriptions require a stable name ( guarded in subscribe() )
|
|
264
|
+
headers['activemq.subscriptionName'] = desc.subscriptionId;
|
|
265
|
+
}
|
|
266
|
+
desc.active = this.Client.subscribe(desc.channel, (message) => {
|
|
267
|
+
let qMessage;
|
|
268
|
+
try {
|
|
269
|
+
qMessage = JSON.parse(message.body);
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
this.Log.error(`Cannot parse message body on channel ${desc.channel}: ${err.message}`);
|
|
273
|
+
this.handleUnparseableMessage(message, desc.channel, err);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
// luxon DateTime serializes to an ISO string over the wire - rehydrate it
|
|
277
|
+
if (typeof qMessage.CreatedAt === 'string') {
|
|
278
|
+
qMessage.CreatedAt = DateTime.fromISO(qMessage.CreatedAt);
|
|
279
|
+
}
|
|
280
|
+
desc
|
|
281
|
+
.callback(qMessage)
|
|
282
|
+
.then(() => {
|
|
283
|
+
message.ack();
|
|
284
|
+
})
|
|
285
|
+
.catch((err) => {
|
|
286
|
+
this.handleFailedMessage(message, qMessage, desc, err);
|
|
287
|
+
});
|
|
288
|
+
}, headers);
|
|
289
|
+
this.Log.success(`Channel ${desc.channel}, durable: ${desc.durable ? 'true' : 'false'} subscribed and ready to receive messages !`);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Handles a message whose consumer callback rejected.
|
|
293
|
+
*
|
|
294
|
+
* Events ( fire-and-forget ) are logged and acked ( dropped ) - the queue model
|
|
295
|
+
* does not retry them. Jobs are retried up to their RetryCount by re-publishing
|
|
296
|
+
* to the same channel with an incremented retry header ( and optional backoff ),
|
|
297
|
+
* then dead-lettered once retries are exhausted.
|
|
298
|
+
*/
|
|
299
|
+
handleFailedMessage(message, qMessage, desc, err) {
|
|
300
|
+
const reason = err?.message ?? String(err);
|
|
301
|
+
// events are not retried or tracked - drop them
|
|
302
|
+
if (qMessage.Type !== QueueMessageType.Job) {
|
|
303
|
+
this.Log.warn(`Event handler failed on channel ${desc.channel}, dropping message ${qMessage.Name}. ${reason}`);
|
|
304
|
+
message.ack();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const maxRetries = qMessage.RetryCount ?? 0;
|
|
308
|
+
const attempt = Number(message.headers?.[RETRY_COUNT_HEADER] ?? '0');
|
|
309
|
+
if (attempt < maxRetries) {
|
|
310
|
+
const nextAttempt = attempt + 1;
|
|
311
|
+
const delay = this.retryBackoff(nextAttempt);
|
|
312
|
+
const headers = {
|
|
313
|
+
persistent: 'true',
|
|
314
|
+
'content-type': 'application/json',
|
|
315
|
+
[RETRY_COUNT_HEADER]: `${nextAttempt}`,
|
|
316
|
+
};
|
|
317
|
+
// preserve app-relevant delivery headers across the retry republish.
|
|
318
|
+
// NOTE: original AMQ_SCHEDULED_* are intentionally dropped - the backoff delay below
|
|
319
|
+
// replaces scheduling for the retry ( we don't want to re-run a cron on a retry ).
|
|
320
|
+
if (qMessage.Priority) {
|
|
321
|
+
headers.priority = `${qMessage.Priority}`;
|
|
322
|
+
}
|
|
323
|
+
if (qMessage.JobId) {
|
|
324
|
+
headers['correlation-id'] = qMessage.JobId;
|
|
325
|
+
}
|
|
326
|
+
if (delay > 0) {
|
|
327
|
+
headers['AMQ_SCHEDULED_DELAY'] = `${delay}`;
|
|
328
|
+
}
|
|
329
|
+
try {
|
|
330
|
+
// ack the original and reschedule a fresh delivery to the same channel
|
|
331
|
+
this.Client.publish({ destination: desc.channel, body: message.body, headers });
|
|
332
|
+
message.ack();
|
|
333
|
+
this.Log.warn(`Job ${qMessage.Name} failed on ${desc.channel}, retry ${nextAttempt}/${maxRetries} scheduled in ${delay}ms. ${reason}`);
|
|
334
|
+
}
|
|
335
|
+
catch (retryErr) {
|
|
336
|
+
this.Log.error(`Failed to reschedule job ${qMessage.Name} on ${desc.channel}, nacking instead: ${retryErr.message}`);
|
|
337
|
+
message.nack();
|
|
338
|
+
}
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
// retries exhausted - route to dead-letter
|
|
342
|
+
this.deadLetter(message, this.getDeadLetterChannelForMessage(qMessage), desc.channel, reason, attempt);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Handles a message whose body could not be parsed as JSON. It cannot be retried
|
|
346
|
+
* ( we don't know its type ), so it is dead-lettered or nacked.
|
|
347
|
+
*/
|
|
348
|
+
handleUnparseableMessage(message, channel, err) {
|
|
349
|
+
const reason = err?.message ?? String(err);
|
|
350
|
+
this.deadLetter(message, this.Options.defaultQueueDeadLetterChannel, channel, reason);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Publishes a failed message to the given dead-letter channel and acks the original
|
|
354
|
+
* to unblock the source queue. When no dead-letter channel is configured the message is
|
|
355
|
+
* dropped ( acked ) with a warning - we never nack-loop a poison message forever.
|
|
356
|
+
*/
|
|
357
|
+
deadLetter(message, dlq, channel, reason, attempt) {
|
|
358
|
+
if (!dlq) {
|
|
359
|
+
// retries are already exhausted here; nacking would just redeliver into another exhausted
|
|
360
|
+
// cycle forever. Drop it ( ack ) with a loud warning so the source queue is unblocked.
|
|
361
|
+
this.Log.warn(`Message failed on channel ${channel}, retries exhausted and no dead-letter channel configured - dropping. ${reason}`);
|
|
362
|
+
message.ack();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
try {
|
|
366
|
+
const headers = {
|
|
367
|
+
persistent: 'true',
|
|
368
|
+
'content-type': 'application/json',
|
|
369
|
+
'x-original-destination': channel,
|
|
370
|
+
'x-error': reason,
|
|
371
|
+
};
|
|
372
|
+
if (attempt !== undefined) {
|
|
373
|
+
headers[RETRY_COUNT_HEADER] = `${attempt}`;
|
|
374
|
+
}
|
|
375
|
+
this.Client.publish({ destination: dlq, body: message.body, headers });
|
|
376
|
+
message.ack();
|
|
377
|
+
this.Log.warn(`Message failed on channel ${channel}, routed to dead-letter ${dlq}. ${reason}`);
|
|
378
|
+
}
|
|
379
|
+
catch (dlqErr) {
|
|
380
|
+
this.Log.error(`Failed to route message to dead-letter ${dlq}, nacking instead: ${dlqErr.message}`);
|
|
381
|
+
message.nack();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Exponential backoff ( ms ) for the given retry attempt, based on `Options.retryDelay`.
|
|
386
|
+
* Returns 0 ( immediate redelivery ) when no base delay is configured.
|
|
387
|
+
*/
|
|
388
|
+
retryBackoff(attempt) {
|
|
389
|
+
const base = this.Options.retryDelay ?? 0;
|
|
390
|
+
return base > 0 ? base * 2 ** (attempt - 1) : 0;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Publisher-side resilience pipeline used by emit(). Retries a failed / timed-out receipt
|
|
394
|
+
* publish with exponential backoff ( the per-attempt timeout lives in publishWithReceipt ).
|
|
395
|
+
*/
|
|
396
|
+
buildEmitPipeline() {
|
|
397
|
+
const attempts = this.Options.options?.emitRetries ?? 3;
|
|
398
|
+
const base = this.Options.retryDelay && this.Options.retryDelay > 0 ? this.Options.retryDelay : 200;
|
|
399
|
+
return new ResiliencePipelineBuilder()
|
|
400
|
+
.addRetry({ MaxRetryAttempts: attempts, Delay: base, MaxDelay: 30000, BackoffType: BackoffType.Exponential, UseJitter: true })
|
|
401
|
+
.build();
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Publishes a message to all of its routed channels and resolves only once the
|
|
405
|
+
* broker has acknowledged each publish with a RECEIPT frame.
|
|
406
|
+
*/
|
|
407
|
+
publishMessage(message) {
|
|
93
408
|
const channels = this.getChannelForMessage(message);
|
|
94
|
-
const headers = {};
|
|
409
|
+
const headers = { 'content-type': 'application/json' };
|
|
410
|
+
// tie jobs to their JobModel row for broker-side traceability
|
|
411
|
+
if (message.JobId) {
|
|
412
|
+
headers['correlation-id'] = message.JobId;
|
|
413
|
+
}
|
|
95
414
|
if (message.Persistent) {
|
|
96
415
|
headers['persistent'] = 'true';
|
|
97
416
|
}
|
|
@@ -110,55 +429,58 @@ let StompQueueClient = class StompQueueClient extends QueueClient {
|
|
|
110
429
|
if (message.ScheduleRepeat) {
|
|
111
430
|
headers['AMQ_SCHEDULED_REPEAT'] = message.ScheduleRepeat.toString();
|
|
112
431
|
}
|
|
113
|
-
|
|
432
|
+
const body = JSON.stringify(message);
|
|
433
|
+
return Promise.all(channels.map((c) => this.EmitPipeline.execute(() => this.publishWithReceipt(c, body, headers, message)))).then(() => undefined);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Publishes to a single channel and waits for the broker RECEIPT frame so the
|
|
437
|
+
* caller gets real delivery confirmation ( bounded by `ReceiptTimeout` ).
|
|
438
|
+
*/
|
|
439
|
+
publishWithReceipt(channel, body, headers, message) {
|
|
440
|
+
return new Promise((resolve, reject) => {
|
|
441
|
+
const receiptId = randomUUID();
|
|
442
|
+
let timer;
|
|
443
|
+
this.Client.watchForReceipt(receiptId, () => {
|
|
444
|
+
clearTimeout(timer);
|
|
445
|
+
this.Log.trace(`Published ${message.Type} Name: ${message.Name} to channel ${channel} ( ${this.Options.name} )`);
|
|
446
|
+
resolve();
|
|
447
|
+
});
|
|
448
|
+
timer = setTimeout(() => {
|
|
449
|
+
reject(new UnexpectedServerError(`Timeout waiting for broker receipt while publishing to ${channel} ( ${this.Options.name} )`));
|
|
450
|
+
}, this.ReceiptTimeout);
|
|
114
451
|
this.Client.publish({
|
|
115
|
-
destination:
|
|
116
|
-
body
|
|
117
|
-
headers,
|
|
452
|
+
destination: channel,
|
|
453
|
+
body,
|
|
454
|
+
headers: { ...headers, receipt: receiptId },
|
|
118
455
|
});
|
|
119
|
-
this.Log.trace(`Published ${message.Type} Name: ${message.Name} to channel ${c} ( ${this.Options.name} )`);
|
|
120
456
|
});
|
|
121
457
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
458
|
+
/**
|
|
459
|
+
* Flushes messages buffered while disconnected. Called from `onConnect`.
|
|
460
|
+
*/
|
|
461
|
+
flushPendingEmits() {
|
|
462
|
+
if (this.PendingEmits.length === 0) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const pending = this.PendingEmits;
|
|
466
|
+
this.PendingEmits = [];
|
|
467
|
+
this.Log.info(`Flushing ${pending.length} buffered message(s) for queue ${this.Options.name}`);
|
|
468
|
+
for (const p of pending) {
|
|
469
|
+
this.publishMessage(p.message).then(p.resolve).catch(p.reject);
|
|
470
|
+
}
|
|
131
471
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if (!subscriptionId) {
|
|
145
|
-
throw new InvalidArgument(`subscriptionId cannot be empty if using durable subscriptions`);
|
|
146
|
-
}
|
|
147
|
-
headers['activemq.subscriptionName'] = subscriptionId;
|
|
148
|
-
}
|
|
149
|
-
const subscription = this.Client.subscribe(c, (message) => {
|
|
150
|
-
const qMessage = JSON.parse(message.body);
|
|
151
|
-
callback(qMessage)
|
|
152
|
-
.then(() => {
|
|
153
|
-
message.ack();
|
|
154
|
-
})
|
|
155
|
-
.catch(() => {
|
|
156
|
-
message.nack();
|
|
157
|
-
});
|
|
158
|
-
}, headers);
|
|
159
|
-
this.Subscriptions.set(c, subscription);
|
|
160
|
-
this.Log.success(`Channel ${c}, durable: ${durable ? 'true' : 'false'} subscribed and ready to receive messages !`);
|
|
161
|
-
});
|
|
472
|
+
/**
|
|
473
|
+
* Resolves everyone waiting on {@link whenReady}. Called from `onConnect`.
|
|
474
|
+
*/
|
|
475
|
+
flushReadyWaiters() {
|
|
476
|
+
if (this.ReadyWaiters.length === 0) {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
const waiters = this.ReadyWaiters;
|
|
480
|
+
this.ReadyWaiters = [];
|
|
481
|
+
for (const w of waiters) {
|
|
482
|
+
w();
|
|
483
|
+
}
|
|
162
484
|
}
|
|
163
485
|
};
|
|
164
486
|
StompQueueClient = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAA0C,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AACnG,OAAO,KAAK,MAAM,gBAAgB,CAAC;AACnC,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAe,UAAU,E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AA9hBY,gBAAgB;IAF5B,gBAAgB,EAAE;IAClB,UAAU,CAAC,WAAW,CAAC;;GACX,gBAAgB,CA8hB5B"}
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './connection-factory.js';
|
|
2
|
+
export * from './connection.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/mjs/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './connection-factory.js';
|
|
2
|
+
export * from './connection.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|