@amqp-contract/core 0.22.0 → 0.23.1

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/dist/index.cjs CHANGED
@@ -25,6 +25,7 @@ let _swan_io_boxed = require("@swan-io/boxed");
25
25
  let amqp_connection_manager = require("amqp-connection-manager");
26
26
  amqp_connection_manager = __toESM(amqp_connection_manager, 1);
27
27
  let _amqp_contract_contract = require("@amqp-contract/contract");
28
+ let node_module = require("node:module");
28
29
  //#region src/connection-manager.ts
29
30
  /**
30
31
  * Connection manager singleton for sharing AMQP connections across clients.
@@ -157,6 +158,25 @@ var ConnectionManagerSingleton = class ConnectionManagerSingleton {
157
158
  this.refCounts.clear();
158
159
  }
159
160
  };
161
+ /**
162
+ * Number of active pooled connections. Test-only helper — exposed in lieu of
163
+ * the underlying singleton, which is intentionally not part of the public API
164
+ * (mutating it from outside the library can break in-flight clients sharing a
165
+ * connection).
166
+ *
167
+ * @internal
168
+ */
169
+ function _getConnectionCountForTesting() {
170
+ return ConnectionManagerSingleton.getInstance()._getConnectionCountForTesting();
171
+ }
172
+ /**
173
+ * Close every pooled connection and clear ref-counts. Test-only helper.
174
+ *
175
+ * @internal
176
+ */
177
+ function _resetConnectionsForTesting() {
178
+ return ConnectionManagerSingleton.getInstance()._resetForTesting();
179
+ }
160
180
  //#endregion
161
181
  //#region src/errors.ts
162
182
  /**
@@ -298,6 +318,28 @@ function callSetupFunc(setup, channel) {
298
318
  return setup(channel);
299
319
  }
300
320
  /**
321
+ * Default time `waitForConnect` will wait for the broker before erroring out.
322
+ * Defaulting to a finite value (rather than waiting forever) means a fail-fast
323
+ * developer experience: a misconfigured URL, a down broker, or wrong
324
+ * credentials surface as a Result.Error within 30 seconds. Pass `null`
325
+ * explicitly to disable the timeout — `Infinity` and other non-finite values
326
+ * are also coerced to "no timeout" because Node's `setTimeout` clamps large
327
+ * delays to ~24.8 days and silently fires near-immediately on `Infinity`.
328
+ */
329
+ const DEFAULT_CONNECT_TIMEOUT_MS = 3e4;
330
+ /**
331
+ * Normalise the user-supplied connect timeout to either a positive finite
332
+ * number of milliseconds, or `null` (no timeout). `Infinity`, `NaN`, and
333
+ * non-positive values all map to `null` rather than being passed to
334
+ * `setTimeout` — see {@link DEFAULT_CONNECT_TIMEOUT_MS}.
335
+ */
336
+ function resolveConnectTimeoutMs(input) {
337
+ if (input === null) return null;
338
+ if (input === void 0) return DEFAULT_CONNECT_TIMEOUT_MS;
339
+ if (!Number.isFinite(input) || input <= 0) return null;
340
+ return input;
341
+ }
342
+ /**
301
343
  * AMQP client that manages connections and channels with automatic topology setup.
302
344
  *
303
345
  * This class handles:
@@ -330,6 +372,7 @@ var AmqpClient = class {
330
372
  channelWrapper;
331
373
  urls;
332
374
  connectionOptions;
375
+ /** Resolved timeout in ms; `null` means "wait forever". */
333
376
  connectTimeoutMs;
334
377
  /**
335
378
  * Create a new AMQP client instance.
@@ -346,7 +389,7 @@ var AmqpClient = class {
346
389
  this.contract = contract;
347
390
  this.urls = options.urls;
348
391
  if (options.connectionOptions !== void 0) this.connectionOptions = options.connectionOptions;
349
- if (options.connectTimeoutMs !== void 0) this.connectTimeoutMs = options.connectTimeoutMs;
392
+ this.connectTimeoutMs = resolveConnectTimeoutMs(options.connectTimeoutMs);
350
393
  const singleton = ConnectionManagerSingleton.getInstance();
351
394
  this.connection = singleton.getConnection(options.urls, options.connectionOptions);
352
395
  const defaultSetup = (channel) => setupAmqpTopology(channel, this.contract);
@@ -394,8 +437,8 @@ var AmqpClient = class {
394
437
  */
395
438
  waitForConnect() {
396
439
  const connectPromise = this.channelWrapper.waitForConnect();
397
- const racedPromise = this.connectTimeoutMs === void 0 ? connectPromise : new Promise((resolve, reject) => {
398
- const timeoutMs = this.connectTimeoutMs;
440
+ const timeoutMs = this.connectTimeoutMs;
441
+ const racedPromise = timeoutMs === null ? connectPromise : new Promise((resolve, reject) => {
399
442
  const handle = setTimeout(() => {
400
443
  reject(/* @__PURE__ */ new Error(`Timed out waiting for AMQP connection after ${timeoutMs}ms`));
401
444
  }, timeoutMs);
@@ -556,13 +599,27 @@ const MessagingSemanticConventions = {
556
599
  * Instrumentation scope name for amqp-contract.
557
600
  */
558
601
  const INSTRUMENTATION_SCOPE_NAME = "@amqp-contract";
559
- const INSTRUMENTATION_SCOPE_VERSION = "0.1.0";
602
+ /**
603
+ * Instrumentation scope version, sourced from this package's package.json so
604
+ * the OTel meter version always tracks the released library version. We use
605
+ * `createRequire` rather than a JSON import attribute so the same source builds
606
+ * to ESM, CJS, and runs under bundlers that don't yet understand
607
+ * `import … with { type: "json" }`.
608
+ */
609
+ const INSTRUMENTATION_SCOPE_VERSION = (() => {
610
+ try {
611
+ return (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("../package.json").version ?? "0.0.0";
612
+ } catch {
613
+ return "0.0.0";
614
+ }
615
+ })();
560
616
  let otelApi;
561
617
  let cachedTracer;
562
618
  let cachedPublishCounter;
563
619
  let cachedConsumeCounter;
564
620
  let cachedPublishLatencyHistogram;
565
621
  let cachedConsumeLatencyHistogram;
622
+ let cachedLateRpcReplyCounter;
566
623
  /**
567
624
  * Try to load the OpenTelemetry API module.
568
625
  * Returns null if the module is not available.
@@ -593,14 +650,16 @@ function getMeterInstruments() {
593
650
  publishCounter: cachedPublishCounter,
594
651
  consumeCounter: cachedConsumeCounter,
595
652
  publishLatencyHistogram: cachedPublishLatencyHistogram,
596
- consumeLatencyHistogram: cachedConsumeLatencyHistogram
653
+ consumeLatencyHistogram: cachedConsumeLatencyHistogram,
654
+ lateRpcReplyCounter: cachedLateRpcReplyCounter
597
655
  };
598
656
  const api = tryLoadOpenTelemetryApi();
599
657
  if (!api) return {
600
658
  publishCounter: void 0,
601
659
  consumeCounter: void 0,
602
660
  publishLatencyHistogram: void 0,
603
- consumeLatencyHistogram: void 0
661
+ consumeLatencyHistogram: void 0,
662
+ lateRpcReplyCounter: void 0
604
663
  };
605
664
  const meter = api.metrics.getMeter(INSTRUMENTATION_SCOPE_NAME, INSTRUMENTATION_SCOPE_VERSION);
606
665
  cachedPublishCounter = meter.createCounter("amqp.client.messages.published", {
@@ -619,11 +678,16 @@ function getMeterInstruments() {
619
678
  description: "Duration of message processing operations",
620
679
  unit: "ms"
621
680
  });
681
+ cachedLateRpcReplyCounter = meter.createCounter("amqp.client.rpc.late_reply", {
682
+ description: "RPC replies received after the caller stopped waiting (timeout, cancellation, or unknown correlationId)",
683
+ unit: "{message}"
684
+ });
622
685
  return {
623
686
  publishCounter: cachedPublishCounter,
624
687
  consumeCounter: cachedConsumeCounter,
625
688
  publishLatencyHistogram: cachedPublishLatencyHistogram,
626
- consumeLatencyHistogram: cachedConsumeLatencyHistogram
689
+ consumeLatencyHistogram: cachedConsumeLatencyHistogram,
690
+ lateRpcReplyCounter: cachedLateRpcReplyCounter
627
691
  };
628
692
  }
629
693
  /**
@@ -634,7 +698,8 @@ const defaultTelemetryProvider = {
634
698
  getPublishCounter: () => getMeterInstruments().publishCounter,
635
699
  getConsumeCounter: () => getMeterInstruments().consumeCounter,
636
700
  getPublishLatencyHistogram: () => getMeterInstruments().publishLatencyHistogram,
637
- getConsumeLatencyHistogram: () => getMeterInstruments().consumeLatencyHistogram
701
+ getConsumeLatencyHistogram: () => getMeterInstruments().consumeLatencyHistogram,
702
+ getLateRpcReplyCounter: () => getMeterInstruments().lateRpcReplyCounter
638
703
  };
639
704
  /**
640
705
  * Create a span for a publish operation.
@@ -732,6 +797,22 @@ function recordConsumeMetric(provider, queueName, consumerName, success, duratio
732
797
  consumeLatencyHistogram?.record(durationMs, attributes);
733
798
  }
734
799
  /**
800
+ * Record an RPC reply that arrived after the caller stopped waiting.
801
+ *
802
+ * @param reason - Why the reply was orphaned. `"unknown-correlation-id"` is
803
+ * the typical "caller already timed out" case; `"missing-correlation-id"`
804
+ * means the broker delivered a reply with no correlationId at all (a
805
+ * protocol violation by the responder).
806
+ */
807
+ function recordLateRpcReply(provider, reason) {
808
+ const counter = provider.getLateRpcReplyCounter();
809
+ const attributes = {
810
+ [MessagingSemanticConventions.MESSAGING_SYSTEM]: MessagingSemanticConventions.MESSAGING_SYSTEM_RABBITMQ,
811
+ reason
812
+ };
813
+ counter?.add(1, attributes);
814
+ }
815
+ /**
735
816
  * Reset the cached OpenTelemetry API module and instruments.
736
817
  * For testing purposes only.
737
818
  * @internal
@@ -743,18 +824,22 @@ function _resetTelemetryCacheForTesting() {
743
824
  cachedConsumeCounter = void 0;
744
825
  cachedPublishLatencyHistogram = void 0;
745
826
  cachedConsumeLatencyHistogram = void 0;
827
+ cachedLateRpcReplyCounter = void 0;
746
828
  }
747
829
  //#endregion
748
830
  exports.AmqpClient = AmqpClient;
749
- exports.ConnectionManagerSingleton = ConnectionManagerSingleton;
831
+ exports.DEFAULT_CONNECT_TIMEOUT_MS = DEFAULT_CONNECT_TIMEOUT_MS;
750
832
  exports.MessageValidationError = MessageValidationError;
751
833
  exports.MessagingSemanticConventions = MessagingSemanticConventions;
752
834
  exports.TechnicalError = TechnicalError;
835
+ exports._getConnectionCountForTesting = _getConnectionCountForTesting;
836
+ exports._resetConnectionsForTesting = _resetConnectionsForTesting;
753
837
  exports._resetTelemetryCacheForTesting = _resetTelemetryCacheForTesting;
754
838
  exports.defaultTelemetryProvider = defaultTelemetryProvider;
755
839
  exports.endSpanError = endSpanError;
756
840
  exports.endSpanSuccess = endSpanSuccess;
757
841
  exports.recordConsumeMetric = recordConsumeMetric;
842
+ exports.recordLateRpcReply = recordLateRpcReply;
758
843
  exports.recordPublishMetric = recordPublishMetric;
759
844
  exports.setupAmqpTopology = setupAmqpTopology;
760
845
  exports.startConsumeSpan = startConsumeSpan;
package/dist/index.d.cts CHANGED
@@ -31,20 +31,32 @@ declare class MessageValidationError extends Error {
31
31
  }
32
32
  //#endregion
33
33
  //#region src/amqp-client.d.ts
34
+ /**
35
+ * Default time `waitForConnect` will wait for the broker before erroring out.
36
+ * Defaulting to a finite value (rather than waiting forever) means a fail-fast
37
+ * developer experience: a misconfigured URL, a down broker, or wrong
38
+ * credentials surface as a Result.Error within 30 seconds. Pass `null`
39
+ * explicitly to disable the timeout — `Infinity` and other non-finite values
40
+ * are also coerced to "no timeout" because Node's `setTimeout` clamps large
41
+ * delays to ~24.8 days and silently fires near-immediately on `Infinity`.
42
+ */
43
+ declare const DEFAULT_CONNECT_TIMEOUT_MS = 30000;
34
44
  /**
35
45
  * Options for creating an AMQP client.
36
46
  *
37
47
  * @property urls - AMQP broker URL(s). Multiple URLs provide failover support.
38
48
  * @property connectionOptions - Optional connection configuration (heartbeat, reconnect settings, etc.).
39
49
  * @property channelOptions - Optional channel configuration options.
40
- * @property connectTimeoutMs - Maximum time in ms to wait for the channel to become ready
41
- * in `waitForConnect`. If unset, waits forever (amqp-connection-manager retries indefinitely).
50
+ * @property connectTimeoutMs - Maximum time in ms to wait for the channel to
51
+ * become ready in `waitForConnect`. Defaults to {@link DEFAULT_CONNECT_TIMEOUT_MS}.
52
+ * Pass `null` to disable the timeout entirely (amqp-connection-manager will
53
+ * retry indefinitely).
42
54
  */
43
55
  type AmqpClientOptions = {
44
56
  urls: ConnectionUrl[];
45
57
  connectionOptions?: AmqpConnectionManagerOptions | undefined;
46
58
  channelOptions?: Partial<CreateChannelOpts> | undefined;
47
- connectTimeoutMs?: number | undefined;
59
+ connectTimeoutMs?: number | null | undefined;
48
60
  };
49
61
  /**
50
62
  * Callback type for consuming messages.
@@ -96,7 +108,8 @@ declare class AmqpClient {
96
108
  private readonly channelWrapper;
97
109
  private readonly urls;
98
110
  private readonly connectionOptions?;
99
- private readonly connectTimeoutMs?;
111
+ /** Resolved timeout in ms; `null` means "wait forever". */
112
+ private readonly connectTimeoutMs;
100
113
  /**
101
114
  * Create a new AMQP client instance.
102
115
  *
@@ -227,91 +240,20 @@ declare class AmqpClient {
227
240
  //#endregion
228
241
  //#region src/connection-manager.d.ts
229
242
  /**
230
- * Connection manager singleton for sharing AMQP connections across clients.
243
+ * Number of active pooled connections. Test-only helper exposed in lieu of
244
+ * the underlying singleton, which is intentionally not part of the public API
245
+ * (mutating it from outside the library can break in-flight clients sharing a
246
+ * connection).
231
247
  *
232
- * This singleton implements connection pooling to avoid creating multiple connections
233
- * to the same broker, which is a RabbitMQ best practice. Connections are identified
234
- * by their URLs and connection options, and reference counting ensures connections
235
- * are only closed when all clients have released them.
248
+ * @internal
249
+ */
250
+ declare function _getConnectionCountForTesting(): number;
251
+ /**
252
+ * Close every pooled connection and clear ref-counts. Test-only helper.
236
253
  *
237
- * @example
238
- * ```typescript
239
- * const manager = ConnectionManagerSingleton.getInstance();
240
- * const connection = manager.getConnection(['amqp://localhost']);
241
- * // ... use connection ...
242
- * await manager.releaseConnection(['amqp://localhost']);
243
- * ```
254
+ * @internal
244
255
  */
245
- declare class ConnectionManagerSingleton {
246
- private static instance;
247
- private connections;
248
- private refCounts;
249
- private constructor();
250
- /**
251
- * Get the singleton instance of the connection manager.
252
- *
253
- * @returns The singleton instance
254
- */
255
- static getInstance(): ConnectionManagerSingleton;
256
- /**
257
- * Get or create a connection for the given URLs and options.
258
- *
259
- * If a connection already exists with the same URLs and options, it is reused
260
- * and its reference count is incremented. Otherwise, a new connection is created.
261
- *
262
- * @param urls - AMQP broker URL(s)
263
- * @param connectionOptions - Optional connection configuration
264
- * @returns The AMQP connection manager instance
265
- */
266
- getConnection(urls: ConnectionUrl[], connectionOptions?: AmqpConnectionManagerOptions): AmqpConnectionManager;
267
- /**
268
- * Release a connection reference.
269
- *
270
- * Decrements the reference count for the connection. If the count reaches zero,
271
- * the connection is closed and removed from the pool.
272
- *
273
- * @param urls - AMQP broker URL(s) used to identify the connection
274
- * @param connectionOptions - Optional connection configuration used to identify the connection
275
- * @returns A promise that resolves when the connection is released (and closed if necessary)
276
- */
277
- releaseConnection(urls: ConnectionUrl[], connectionOptions?: AmqpConnectionManagerOptions): Promise<void>;
278
- /**
279
- * Create a unique key for a connection based on URLs and options.
280
- *
281
- * The key is deterministic: same URLs and options always produce the same key,
282
- * enabling connection reuse.
283
- *
284
- * @param urls - AMQP broker URL(s)
285
- * @param connectionOptions - Optional connection configuration
286
- * @returns A unique string key identifying the connection
287
- */
288
- private createConnectionKey;
289
- /**
290
- * Serialize connection options to a deterministic string.
291
- *
292
- * @param options - Connection options to serialize
293
- * @returns A JSON string with sorted keys for deterministic comparison
294
- */
295
- private serializeOptions;
296
- /**
297
- * Deep sort an object's keys for deterministic serialization.
298
- *
299
- * @param value - The value to deep sort (can be object, array, or primitive)
300
- * @returns The value with all object keys sorted alphabetically
301
- */
302
- private deepSort;
303
- /**
304
- * Get the number of active pooled connections.
305
- *
306
- * @internal
307
- */
308
- _getConnectionCountForTesting(): number;
309
- /**
310
- * Reset all cached connections (for testing purposes)
311
- * @internal
312
- */
313
- _resetForTesting(): Promise<void>;
314
- }
256
+ declare function _resetConnectionsForTesting(): Promise<void>;
315
257
  //#endregion
316
258
  //#region src/logger.d.ts
317
259
  /**
@@ -443,6 +385,12 @@ type TelemetryProvider = {
443
385
  * Returns undefined if OpenTelemetry is not available.
444
386
  */
445
387
  getConsumeLatencyHistogram: () => Histogram | undefined;
388
+ /**
389
+ * Get a counter for RPC replies that arrive after the caller has gone away
390
+ * (timeout, cancellation, or unknown correlationId). Returns undefined if
391
+ * OpenTelemetry is not available.
392
+ */
393
+ getLateRpcReplyCounter: () => Counter | undefined;
446
394
  };
447
395
  /**
448
396
  * Default telemetry provider that uses OpenTelemetry API if available.
@@ -474,6 +422,15 @@ declare function recordPublishMetric(provider: TelemetryProvider, exchangeName:
474
422
  * Record a consume metric.
475
423
  */
476
424
  declare function recordConsumeMetric(provider: TelemetryProvider, queueName: string, consumerName: string, success: boolean, durationMs: number): void;
425
+ /**
426
+ * Record an RPC reply that arrived after the caller stopped waiting.
427
+ *
428
+ * @param reason - Why the reply was orphaned. `"unknown-correlation-id"` is
429
+ * the typical "caller already timed out" case; `"missing-correlation-id"`
430
+ * means the broker delivered a reply with no correlationId at all (a
431
+ * protocol violation by the responder).
432
+ */
433
+ declare function recordLateRpcReply(provider: TelemetryProvider, reason: "unknown-correlation-id" | "missing-correlation-id"): void;
477
434
  /**
478
435
  * Reset the cached OpenTelemetry API module and instruments.
479
436
  * For testing purposes only.
@@ -481,5 +438,5 @@ declare function recordConsumeMetric(provider: TelemetryProvider, queueName: str
481
438
  */
482
439
  declare function _resetTelemetryCacheForTesting(): void;
483
440
  //#endregion
484
- export { AmqpClient, type AmqpClientOptions, ConnectionManagerSingleton, type ConsumeCallback, type ConsumerOptions, type Logger, type LoggerContext, MessageValidationError, MessagingSemanticConventions, type PublishOptions, TechnicalError, type TelemetryProvider, _resetTelemetryCacheForTesting, defaultTelemetryProvider, endSpanError, endSpanSuccess, recordConsumeMetric, recordPublishMetric, setupAmqpTopology, startConsumeSpan, startPublishSpan };
441
+ export { AmqpClient, type AmqpClientOptions, type ConsumeCallback, type ConsumerOptions, DEFAULT_CONNECT_TIMEOUT_MS, type Logger, type LoggerContext, MessageValidationError, MessagingSemanticConventions, type PublishOptions, TechnicalError, type TelemetryProvider, _getConnectionCountForTesting, _resetConnectionsForTesting, _resetTelemetryCacheForTesting, defaultTelemetryProvider, endSpanError, endSpanSuccess, recordConsumeMetric, recordLateRpcReply, recordPublishMetric, setupAmqpTopology, startConsumeSpan, startPublishSpan };
485
442
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/errors.ts","../src/amqp-client.ts","../src/connection-manager.ts","../src/logger.ts","../src/setup.ts","../src/telemetry.ts"],"mappings":";;;;;;;;;;;;;cAMa,cAAA,SAAuB,KAAA;EAAA,SAGP,KAAA;cADzB,OAAA,UACyB,KAAA;AAAA;;;;;;;;;AAuB7B;cAAa,sBAAA,SAA+B,KAAA;EAAA,SAExB,MAAA;EAAA,SACA,MAAA;cADA,MAAA,UACA,MAAA;AAAA;;;;;AA7BpB;;;;;;;KCwCY,iBAAA;EACV,IAAA,EAAM,aAAA;EACN,iBAAA,GAAoB,4BAAA;EACpB,cAAA,GAAiB,OAAA,CAA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EAAS,OAAA,EACT,QAAA,EAAU,kBAAA,GACT,OAAA;;;;;;;cCJU,4BAAA;EAAA;;;;;;;;;;;;;;;;;;;KA4BD,iBAAA;ELlBQ;;;;EKuBlB,SAAA,QAAiB,MAAA;;;AJXnB;;EIiBE,iBAAA,QAAyB,OAAA;EJhBnB;;;;EIsBN,iBAAA,QAAyB,OAAA;EJpBD;;;;EI0BxB,0BAAA,QAAkC,SAAA;EJ1BlC;;;;EIgCA,0BAAA,QAAkC,SAAA;AAAA;AJzBpC;;;AAAA,cIyIa,wBAAA,EAA0B,iBAAA;;;;;iBAYvB,gBAAA,CACd,QAAA,EAAU,iBAAA,EACV,YAAA,UACA,UAAA,sBACA,UAAA,GAAa,UAAA,GACZ,IAAA;AJrJH;;;;AAAA,iBImLgB,gBAAA,CACd,QAAA,EAAU,iBAAA,EACV,SAAA,UACA,YAAA,UACA,UAAA,GAAa,UAAA,GACZ,IAAA;;;;iBA2Ba,cAAA,CAAe,IAAA,EAAM,IAAA;AJ3MrC;;;AAAA,iBI0NgB,YAAA,CAAa,IAAA,EAAM,IAAA,cAAkB,KAAA,EAAO,KAAA;;;;iBAiB5C,mBAAA,CACd,QAAA,EAAU,iBAAA,EACV,YAAA,UACA,UAAA,sBACA,OAAA,WACA,UAAA;;AJ/MF;;iBIqOgB,mBAAA,CACd,QAAA,EAAU,iBAAA,EACV,SAAA,UACA,YAAA,UACA,OAAA,WACA,UAAA;;;;;;iBAsBc,8BAAA,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/errors.ts","../src/amqp-client.ts","../src/connection-manager.ts","../src/logger.ts","../src/setup.ts","../src/telemetry.ts"],"mappings":";;;;;;;;;;;;;cAMa,cAAA,SAAuB,KAAA;EAAA,SAGP,KAAA;cADzB,OAAA,UACyB,KAAA;AAAA;;;;;;;;;AAuB7B;cAAa,sBAAA,SAA+B,KAAA;EAAA,SAExB,MAAA;EAAA,SACA,MAAA;cADA,MAAA,UACA,MAAA;AAAA;;;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A,sBAAA,QAA8B,OAAA;AAAA;;;;cA2InB,wBAAA,EAA0B,iBAAA;;;;;iBAavB,gBAAA,CACd,QAAA,EAAU,iBAAA,EACV,YAAA,UACA,UAAA,sBACA,UAAA,GAAa,UAAA,GACZ,IAAA;;;;;iBA8Ba,gBAAA,CACd,QAAA,EAAU,iBAAA,EACV,SAAA,UACA,YAAA,UACA,UAAA,GAAa,UAAA,GACZ,IAAA;;;;iBA2Ba,cAAA,CAAe,IAAA,EAAM,IAAA;;;;iBAerB,YAAA,CAAa,IAAA,EAAM,IAAA,cAAkB,KAAA,EAAO,KAAA;;;;iBAiB5C,mBAAA,CACd,QAAA,EAAU,iBAAA,EACV,YAAA,UACA,UAAA,sBACA,OAAA,WACA,UAAA;AJzNF;;;AAAA,iBI+OgB,mBAAA,CACd,QAAA,EAAU,iBAAA,EACV,SAAA,UACA,YAAA,UACA,OAAA,WACA,UAAA;;;;;;;;;iBAyBc,kBAAA,CACd,QAAA,EAAU,iBAAA,EACV,MAAA;;;;;;iBAkBc,8BAAA,CAAA"}
package/dist/index.d.mts CHANGED
@@ -31,20 +31,32 @@ declare class MessageValidationError extends Error {
31
31
  }
32
32
  //#endregion
33
33
  //#region src/amqp-client.d.ts
34
+ /**
35
+ * Default time `waitForConnect` will wait for the broker before erroring out.
36
+ * Defaulting to a finite value (rather than waiting forever) means a fail-fast
37
+ * developer experience: a misconfigured URL, a down broker, or wrong
38
+ * credentials surface as a Result.Error within 30 seconds. Pass `null`
39
+ * explicitly to disable the timeout — `Infinity` and other non-finite values
40
+ * are also coerced to "no timeout" because Node's `setTimeout` clamps large
41
+ * delays to ~24.8 days and silently fires near-immediately on `Infinity`.
42
+ */
43
+ declare const DEFAULT_CONNECT_TIMEOUT_MS = 30000;
34
44
  /**
35
45
  * Options for creating an AMQP client.
36
46
  *
37
47
  * @property urls - AMQP broker URL(s). Multiple URLs provide failover support.
38
48
  * @property connectionOptions - Optional connection configuration (heartbeat, reconnect settings, etc.).
39
49
  * @property channelOptions - Optional channel configuration options.
40
- * @property connectTimeoutMs - Maximum time in ms to wait for the channel to become ready
41
- * in `waitForConnect`. If unset, waits forever (amqp-connection-manager retries indefinitely).
50
+ * @property connectTimeoutMs - Maximum time in ms to wait for the channel to
51
+ * become ready in `waitForConnect`. Defaults to {@link DEFAULT_CONNECT_TIMEOUT_MS}.
52
+ * Pass `null` to disable the timeout entirely (amqp-connection-manager will
53
+ * retry indefinitely).
42
54
  */
43
55
  type AmqpClientOptions = {
44
56
  urls: ConnectionUrl[];
45
57
  connectionOptions?: AmqpConnectionManagerOptions | undefined;
46
58
  channelOptions?: Partial<CreateChannelOpts> | undefined;
47
- connectTimeoutMs?: number | undefined;
59
+ connectTimeoutMs?: number | null | undefined;
48
60
  };
49
61
  /**
50
62
  * Callback type for consuming messages.
@@ -96,7 +108,8 @@ declare class AmqpClient {
96
108
  private readonly channelWrapper;
97
109
  private readonly urls;
98
110
  private readonly connectionOptions?;
99
- private readonly connectTimeoutMs?;
111
+ /** Resolved timeout in ms; `null` means "wait forever". */
112
+ private readonly connectTimeoutMs;
100
113
  /**
101
114
  * Create a new AMQP client instance.
102
115
  *
@@ -227,91 +240,20 @@ declare class AmqpClient {
227
240
  //#endregion
228
241
  //#region src/connection-manager.d.ts
229
242
  /**
230
- * Connection manager singleton for sharing AMQP connections across clients.
243
+ * Number of active pooled connections. Test-only helper exposed in lieu of
244
+ * the underlying singleton, which is intentionally not part of the public API
245
+ * (mutating it from outside the library can break in-flight clients sharing a
246
+ * connection).
231
247
  *
232
- * This singleton implements connection pooling to avoid creating multiple connections
233
- * to the same broker, which is a RabbitMQ best practice. Connections are identified
234
- * by their URLs and connection options, and reference counting ensures connections
235
- * are only closed when all clients have released them.
248
+ * @internal
249
+ */
250
+ declare function _getConnectionCountForTesting(): number;
251
+ /**
252
+ * Close every pooled connection and clear ref-counts. Test-only helper.
236
253
  *
237
- * @example
238
- * ```typescript
239
- * const manager = ConnectionManagerSingleton.getInstance();
240
- * const connection = manager.getConnection(['amqp://localhost']);
241
- * // ... use connection ...
242
- * await manager.releaseConnection(['amqp://localhost']);
243
- * ```
254
+ * @internal
244
255
  */
245
- declare class ConnectionManagerSingleton {
246
- private static instance;
247
- private connections;
248
- private refCounts;
249
- private constructor();
250
- /**
251
- * Get the singleton instance of the connection manager.
252
- *
253
- * @returns The singleton instance
254
- */
255
- static getInstance(): ConnectionManagerSingleton;
256
- /**
257
- * Get or create a connection for the given URLs and options.
258
- *
259
- * If a connection already exists with the same URLs and options, it is reused
260
- * and its reference count is incremented. Otherwise, a new connection is created.
261
- *
262
- * @param urls - AMQP broker URL(s)
263
- * @param connectionOptions - Optional connection configuration
264
- * @returns The AMQP connection manager instance
265
- */
266
- getConnection(urls: ConnectionUrl[], connectionOptions?: AmqpConnectionManagerOptions): AmqpConnectionManager;
267
- /**
268
- * Release a connection reference.
269
- *
270
- * Decrements the reference count for the connection. If the count reaches zero,
271
- * the connection is closed and removed from the pool.
272
- *
273
- * @param urls - AMQP broker URL(s) used to identify the connection
274
- * @param connectionOptions - Optional connection configuration used to identify the connection
275
- * @returns A promise that resolves when the connection is released (and closed if necessary)
276
- */
277
- releaseConnection(urls: ConnectionUrl[], connectionOptions?: AmqpConnectionManagerOptions): Promise<void>;
278
- /**
279
- * Create a unique key for a connection based on URLs and options.
280
- *
281
- * The key is deterministic: same URLs and options always produce the same key,
282
- * enabling connection reuse.
283
- *
284
- * @param urls - AMQP broker URL(s)
285
- * @param connectionOptions - Optional connection configuration
286
- * @returns A unique string key identifying the connection
287
- */
288
- private createConnectionKey;
289
- /**
290
- * Serialize connection options to a deterministic string.
291
- *
292
- * @param options - Connection options to serialize
293
- * @returns A JSON string with sorted keys for deterministic comparison
294
- */
295
- private serializeOptions;
296
- /**
297
- * Deep sort an object's keys for deterministic serialization.
298
- *
299
- * @param value - The value to deep sort (can be object, array, or primitive)
300
- * @returns The value with all object keys sorted alphabetically
301
- */
302
- private deepSort;
303
- /**
304
- * Get the number of active pooled connections.
305
- *
306
- * @internal
307
- */
308
- _getConnectionCountForTesting(): number;
309
- /**
310
- * Reset all cached connections (for testing purposes)
311
- * @internal
312
- */
313
- _resetForTesting(): Promise<void>;
314
- }
256
+ declare function _resetConnectionsForTesting(): Promise<void>;
315
257
  //#endregion
316
258
  //#region src/logger.d.ts
317
259
  /**
@@ -443,6 +385,12 @@ type TelemetryProvider = {
443
385
  * Returns undefined if OpenTelemetry is not available.
444
386
  */
445
387
  getConsumeLatencyHistogram: () => Histogram | undefined;
388
+ /**
389
+ * Get a counter for RPC replies that arrive after the caller has gone away
390
+ * (timeout, cancellation, or unknown correlationId). Returns undefined if
391
+ * OpenTelemetry is not available.
392
+ */
393
+ getLateRpcReplyCounter: () => Counter | undefined;
446
394
  };
447
395
  /**
448
396
  * Default telemetry provider that uses OpenTelemetry API if available.
@@ -474,6 +422,15 @@ declare function recordPublishMetric(provider: TelemetryProvider, exchangeName:
474
422
  * Record a consume metric.
475
423
  */
476
424
  declare function recordConsumeMetric(provider: TelemetryProvider, queueName: string, consumerName: string, success: boolean, durationMs: number): void;
425
+ /**
426
+ * Record an RPC reply that arrived after the caller stopped waiting.
427
+ *
428
+ * @param reason - Why the reply was orphaned. `"unknown-correlation-id"` is
429
+ * the typical "caller already timed out" case; `"missing-correlation-id"`
430
+ * means the broker delivered a reply with no correlationId at all (a
431
+ * protocol violation by the responder).
432
+ */
433
+ declare function recordLateRpcReply(provider: TelemetryProvider, reason: "unknown-correlation-id" | "missing-correlation-id"): void;
477
434
  /**
478
435
  * Reset the cached OpenTelemetry API module and instruments.
479
436
  * For testing purposes only.
@@ -481,5 +438,5 @@ declare function recordConsumeMetric(provider: TelemetryProvider, queueName: str
481
438
  */
482
439
  declare function _resetTelemetryCacheForTesting(): void;
483
440
  //#endregion
484
- export { AmqpClient, type AmqpClientOptions, ConnectionManagerSingleton, type ConsumeCallback, type ConsumerOptions, type Logger, type LoggerContext, MessageValidationError, MessagingSemanticConventions, type PublishOptions, TechnicalError, type TelemetryProvider, _resetTelemetryCacheForTesting, defaultTelemetryProvider, endSpanError, endSpanSuccess, recordConsumeMetric, recordPublishMetric, setupAmqpTopology, startConsumeSpan, startPublishSpan };
441
+ export { AmqpClient, type AmqpClientOptions, type ConsumeCallback, type ConsumerOptions, DEFAULT_CONNECT_TIMEOUT_MS, type Logger, type LoggerContext, MessageValidationError, MessagingSemanticConventions, type PublishOptions, TechnicalError, type TelemetryProvider, _getConnectionCountForTesting, _resetConnectionsForTesting, _resetTelemetryCacheForTesting, defaultTelemetryProvider, endSpanError, endSpanSuccess, recordConsumeMetric, recordLateRpcReply, recordPublishMetric, setupAmqpTopology, startConsumeSpan, startPublishSpan };
485
442
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/errors.ts","../src/amqp-client.ts","../src/connection-manager.ts","../src/logger.ts","../src/setup.ts","../src/telemetry.ts"],"mappings":";;;;;;;;;;;;;cAMa,cAAA,SAAuB,KAAA;EAAA,SAGP,KAAA;cADzB,OAAA,UACyB,KAAA;AAAA;;;;;;;;;AAuB7B;cAAa,sBAAA,SAA+B,KAAA;EAAA,SAExB,MAAA;EAAA,SACA,MAAA;cADA,MAAA,UACA,MAAA;AAAA;;;;;AA7BpB;;;;;;;KCwCY,iBAAA;EACV,IAAA,EAAM,aAAA;EACN,iBAAA,GAAoB,4BAAA;EACpB,cAAA,GAAiB,OAAA,CAAQ,iBAAA;EACzB,gBAAA;AAAA;;;;KAMU,eAAA,IAAmB,GAAA,EAAK,cAAA,mBAAiC,OAAA;;;;KAKzD,cAAA,GAAiB,OAAA,CAAQ,OAAA;ED1BF,gDC4BjC,OAAA;AAAA;;;AAjBF;KAuBY,eAAA,GAAkB,OAAA,CAAQ,OAAA;uCAEpC,QAAA;AAAA;;;;;;;;;;;;;;;AAfF;;;;;;;;;AAKA;;;;;cAyCa,UAAA;EAAA,iBAmBQ,QAAA;EAAA,iBAlBF,UAAA;EAAA,iBACA,cAAA;EAAA,iBACA,IAA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;;;;iBAYvB,gBAAA,CACd,QAAA,EAAU,iBAAA,EACV,YAAA,UACA,UAAA,sBACA,UAAA,GAAa,UAAA,GACZ,IAAA;AJrJH;;;;AAAA,iBImLgB,gBAAA,CACd,QAAA,EAAU,iBAAA,EACV,SAAA,UACA,YAAA,UACA,UAAA,GAAa,UAAA,GACZ,IAAA;;;;iBA2Ba,cAAA,CAAe,IAAA,EAAM,IAAA;AJ3MrC;;;AAAA,iBI0NgB,YAAA,CAAa,IAAA,EAAM,IAAA,cAAkB,KAAA,EAAO,KAAA;;;;iBAiB5C,mBAAA,CACd,QAAA,EAAU,iBAAA,EACV,YAAA,UACA,UAAA,sBACA,OAAA,WACA,UAAA;;AJ/MF;;iBIqOgB,mBAAA,CACd,QAAA,EAAU,iBAAA,EACV,SAAA,UACA,YAAA,UACA,OAAA,WACA,UAAA;;;;;;iBAsBc,8BAAA,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/errors.ts","../src/amqp-client.ts","../src/connection-manager.ts","../src/logger.ts","../src/setup.ts","../src/telemetry.ts"],"mappings":";;;;;;;;;;;;;cAMa,cAAA,SAAuB,KAAA;EAAA,SAGP,KAAA;cADzB,OAAA,UACyB,KAAA;AAAA;;;;;;;;;AAuB7B;cAAa,sBAAA,SAA+B,KAAA;EAAA,SAExB,MAAA;EAAA,SACA,MAAA;cADA,MAAA,UACA,MAAA;AAAA;;;;;AA7BpB;;;;;;;cCwCa,0BAAA;;;;ADdb;;;;;;;;KCwCY,iBAAA;EACV,IAAA,EAAM,aAAA;EACN,iBAAA,GAAoB,4BAAA;EACpB,cAAA,GAAiB,OAAA,CAAQ,iBAAA;EACzB,gBAAA;AAAA;;AA9BF;;KAoCY,eAAA,IAAmB,GAAA,EAAK,cAAA,mBAAiC,OAAA;;;AAVrE;KAeY,cAAA,GAAiB,OAAA,CAAQ,OAAA;kDAEnC,OAAA;AAAA;;;;KAMU,eAAA,GAAkB,OAAA,CAAQ,OAAA;EAtBpC,qCAw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