@amqp-contract/core 0.20.0 → 0.22.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 +2 -2
- package/dist/index.cjs +105 -41
- package/dist/index.d.cts +105 -62
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +103 -60
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +98 -29
- package/dist/index.mjs.map +1 -1
- package/docs/index.md +361 -81
- package/package.json +25 -25
package/docs/index.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
### AmqpClient
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
11
|
+
Defined in: [packages/core/src/amqp-client.ts:103](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L103)
|
|
12
12
|
|
|
13
13
|
AMQP client that manages connections and channels with automatic topology setup.
|
|
14
14
|
|
|
@@ -46,7 +46,7 @@ await client.close().resultToPromise();
|
|
|
46
46
|
new AmqpClient(contract, options): AmqpClient;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
49
|
+
Defined in: [packages/core/src/amqp-client.ts:121](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L121)
|
|
50
50
|
|
|
51
51
|
Create a new AMQP client instance.
|
|
52
52
|
|
|
@@ -74,7 +74,7 @@ The client will automatically:
|
|
|
74
74
|
ack(msg, allUpTo?): void;
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
77
|
+
Defined in: [packages/core/src/amqp-client.ts:295](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L295)
|
|
78
78
|
|
|
79
79
|
Acknowledge a message.
|
|
80
80
|
|
|
@@ -95,7 +95,7 @@ Acknowledge a message.
|
|
|
95
95
|
addSetup(setup): void;
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
98
|
+
Defined in: [packages/core/src/amqp-client.ts:317](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L317)
|
|
99
99
|
|
|
100
100
|
Add a setup function to be called when the channel is created or reconnected.
|
|
101
101
|
|
|
@@ -117,7 +117,7 @@ This is useful for setting up channel-level configuration like prefetch.
|
|
|
117
117
|
cancel(consumerTag): Future<Result<void, TechnicalError>>;
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
120
|
+
Defined in: [packages/core/src/amqp-client.ts:283](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L283)
|
|
121
121
|
|
|
122
122
|
Cancel a consumer by its consumer tag.
|
|
123
123
|
|
|
@@ -139,7 +139,7 @@ A Future that resolves when the consumer is cancelled
|
|
|
139
139
|
close(): Future<Result<void, TechnicalError>>;
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
142
|
+
Defined in: [packages/core/src/amqp-client.ts:346](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L346)
|
|
143
143
|
|
|
144
144
|
Close the channel and release the connection reference.
|
|
145
145
|
|
|
@@ -163,7 +163,7 @@ consume(
|
|
|
163
163
|
options?): Future<Result<string, TechnicalError>>;
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
166
|
+
Defined in: [packages/core/src/amqp-client.ts:267](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L267)
|
|
167
167
|
|
|
168
168
|
Start consuming messages from a queue.
|
|
169
169
|
|
|
@@ -173,7 +173,7 @@ Start consuming messages from a queue.
|
|
|
173
173
|
| ------ | ------ | ------ |
|
|
174
174
|
| `queue` | `string` | The queue name |
|
|
175
175
|
| `callback` | [`ConsumeCallback`](#consumecallback) | The callback to invoke for each message |
|
|
176
|
-
| `options?` | `
|
|
176
|
+
| `options?` | [`ConsumerOptions`](#consumeroptions) | Optional consume options |
|
|
177
177
|
|
|
178
178
|
###### Returns
|
|
179
179
|
|
|
@@ -187,7 +187,7 @@ A Future with `Result<string>` - the consumer tag
|
|
|
187
187
|
getConnection(): IAmqpConnectionManager;
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
190
|
+
Defined in: [packages/core/src/amqp-client.ts:172](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L172)
|
|
191
191
|
|
|
192
192
|
Get the underlying connection manager
|
|
193
193
|
|
|
@@ -210,7 +210,7 @@ nack(
|
|
|
210
210
|
requeue?): void;
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
213
|
+
Defined in: [packages/core/src/amqp-client.ts:306](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L306)
|
|
214
214
|
|
|
215
215
|
Negative acknowledge a message.
|
|
216
216
|
|
|
@@ -232,7 +232,7 @@ Negative acknowledge a message.
|
|
|
232
232
|
on(event, listener): void;
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
235
|
+
Defined in: [packages/core/src/amqp-client.ts:332](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L332)
|
|
236
236
|
|
|
237
237
|
Register an event listener on the channel wrapper.
|
|
238
238
|
|
|
@@ -262,7 +262,7 @@ publish(
|
|
|
262
262
|
options?): Future<Result<boolean, TechnicalError>>;
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
265
|
+
Defined in: [packages/core/src/amqp-client.ts:230](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L230)
|
|
266
266
|
|
|
267
267
|
Publish a message to an exchange.
|
|
268
268
|
|
|
@@ -273,7 +273,34 @@ Publish a message to an exchange.
|
|
|
273
273
|
| `exchange` | `string` | The exchange name |
|
|
274
274
|
| `routingKey` | `string` | The routing key |
|
|
275
275
|
| `content` | `unknown` | The message content (will be JSON serialized if json: true) |
|
|
276
|
-
| `options?` | `
|
|
276
|
+
| `options?` | [`PublishOptions`](#publishoptions) | Optional publish options |
|
|
277
|
+
|
|
278
|
+
###### Returns
|
|
279
|
+
|
|
280
|
+
`Future`<`Result`<`boolean`, [`TechnicalError`](#technicalerror)>>
|
|
281
|
+
|
|
282
|
+
A Future with `Result<boolean>` - true if message was sent, false if channel buffer is full
|
|
283
|
+
|
|
284
|
+
##### sendToQueue()
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
sendToQueue(
|
|
288
|
+
queue,
|
|
289
|
+
content,
|
|
290
|
+
options?): Future<Result<boolean, TechnicalError>>;
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Defined in: [packages/core/src/amqp-client.ts:249](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L249)
|
|
294
|
+
|
|
295
|
+
Publish a message directly to a queue.
|
|
296
|
+
|
|
297
|
+
###### Parameters
|
|
298
|
+
|
|
299
|
+
| Parameter | Type | Description |
|
|
300
|
+
| ------ | ------ | ------ |
|
|
301
|
+
| `queue` | `string` | The queue name |
|
|
302
|
+
| `content` | `unknown` | The message content (will be JSON serialized if json: true) |
|
|
303
|
+
| `options?` | [`PublishOptions`](#publishoptions) | Optional publish options |
|
|
277
304
|
|
|
278
305
|
###### Returns
|
|
279
306
|
|
|
@@ -287,21 +314,33 @@ A Future with `Result<boolean>` - true if message was sent, false if channel buf
|
|
|
287
314
|
waitForConnect(): Future<Result<void, TechnicalError>>;
|
|
288
315
|
```
|
|
289
316
|
|
|
290
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
317
|
+
Defined in: [packages/core/src/amqp-client.ts:193](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L193)
|
|
291
318
|
|
|
292
319
|
Wait for the channel to be connected and ready.
|
|
293
320
|
|
|
321
|
+
If `connectTimeoutMs` was provided in the constructor options, the returned
|
|
322
|
+
Future resolves to `Result.Error<TechnicalError>` once the timeout elapses.
|
|
323
|
+
Without a timeout, this waits forever — amqp-connection-manager retries
|
|
324
|
+
connections indefinitely and never errors on its own.
|
|
325
|
+
|
|
326
|
+
NOTE: When using `AmqpClient` directly (not via `TypedAmqpClient` /
|
|
327
|
+
`TypedAmqpWorker`), the constructor has already incremented the pooled
|
|
328
|
+
connection's reference count. Callers must invoke `close()` on the error
|
|
329
|
+
path to release the connection — `waitForConnect` does not do this
|
|
330
|
+
automatically. The typed factories handle this cleanup for you.
|
|
331
|
+
|
|
294
332
|
###### Returns
|
|
295
333
|
|
|
296
334
|
`Future`<`Result`<`void`, [`TechnicalError`](#technicalerror)>>
|
|
297
335
|
|
|
298
|
-
A Future
|
|
336
|
+
A Future resolving to `Result.Ok(void)` on connect, or
|
|
337
|
+
`Result.Error(TechnicalError)` on timeout / connection failure.
|
|
299
338
|
|
|
300
339
|
***
|
|
301
340
|
|
|
302
341
|
### ConnectionManagerSingleton
|
|
303
342
|
|
|
304
|
-
Defined in: [packages/core/src/connection-manager.ts:23](https://github.com/btravers/amqp-contract/blob/
|
|
343
|
+
Defined in: [packages/core/src/connection-manager.ts:23](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/connection-manager.ts#L23)
|
|
305
344
|
|
|
306
345
|
Connection manager singleton for sharing AMQP connections across clients.
|
|
307
346
|
|
|
@@ -327,7 +366,7 @@ await manager.releaseConnection(['amqp://localhost']);
|
|
|
327
366
|
getConnection(urls, connectionOptions?): IAmqpConnectionManager;
|
|
328
367
|
```
|
|
329
368
|
|
|
330
|
-
Defined in: [packages/core/src/connection-manager.ts:52](https://github.com/btravers/amqp-contract/blob/
|
|
369
|
+
Defined in: [packages/core/src/connection-manager.ts:52](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/connection-manager.ts#L52)
|
|
331
370
|
|
|
332
371
|
Get or create a connection for the given URLs and options.
|
|
333
372
|
|
|
@@ -353,7 +392,7 @@ The AMQP connection manager instance
|
|
|
353
392
|
releaseConnection(urls, connectionOptions?): Promise<void>;
|
|
354
393
|
```
|
|
355
394
|
|
|
356
|
-
Defined in: [packages/core/src/connection-manager.ts:81](https://github.com/btravers/amqp-contract/blob/
|
|
395
|
+
Defined in: [packages/core/src/connection-manager.ts:81](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/connection-manager.ts#L81)
|
|
357
396
|
|
|
358
397
|
Release a connection reference.
|
|
359
398
|
|
|
@@ -379,7 +418,7 @@ A promise that resolves when the connection is released (and closed if necessary
|
|
|
379
418
|
static getInstance(): ConnectionManagerSingleton;
|
|
380
419
|
```
|
|
381
420
|
|
|
382
|
-
Defined in: [packages/core/src/connection-manager.ts:35](https://github.com/btravers/amqp-contract/blob/
|
|
421
|
+
Defined in: [packages/core/src/connection-manager.ts:35](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/connection-manager.ts#L35)
|
|
383
422
|
|
|
384
423
|
Get the singleton instance of the connection manager.
|
|
385
424
|
|
|
@@ -393,7 +432,7 @@ The singleton instance
|
|
|
393
432
|
|
|
394
433
|
### MessageValidationError
|
|
395
434
|
|
|
396
|
-
Defined in: [packages/core/src/errors.ts:33](https://github.com/btravers/amqp-contract/blob/
|
|
435
|
+
Defined in: [packages/core/src/errors.ts:33](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L33)
|
|
397
436
|
|
|
398
437
|
Error thrown when message validation fails (payload or headers).
|
|
399
438
|
|
|
@@ -420,7 +459,7 @@ The validation issues from the Standard Schema validation
|
|
|
420
459
|
new MessageValidationError(source, issues): MessageValidationError;
|
|
421
460
|
```
|
|
422
461
|
|
|
423
|
-
Defined in: [packages/core/src/errors.ts:34](https://github.com/btravers/amqp-contract/blob/
|
|
462
|
+
Defined in: [packages/core/src/errors.ts:34](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L34)
|
|
424
463
|
|
|
425
464
|
###### Parameters
|
|
426
465
|
|
|
@@ -443,23 +482,94 @@ Error.constructor
|
|
|
443
482
|
|
|
444
483
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
445
484
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
446
|
-
| <a id="cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | node\_modules/.pnpm/typescript@
|
|
447
|
-
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/core/src/errors.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
448
|
-
| <a id="message"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@
|
|
449
|
-
| <a id="name"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@
|
|
450
|
-
| <a id="source"></a> `source` | `readonly` | `string` | - | - | [packages/core/src/errors.ts:35](https://github.com/btravers/amqp-contract/blob/
|
|
451
|
-
| <a id="stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@
|
|
452
|
-
| <a id="stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | node\_modules/.pnpm/@types+node@25.
|
|
485
|
+
| <a id="cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 |
|
|
486
|
+
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/core/src/errors.ts:36](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L36) |
|
|
487
|
+
| <a id="message"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
|
|
488
|
+
| <a id="name"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
|
|
489
|
+
| <a id="source"></a> `source` | `readonly` | `string` | - | - | [packages/core/src/errors.ts:35](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L35) |
|
|
490
|
+
| <a id="stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
|
|
491
|
+
| <a id="stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:67 |
|
|
453
492
|
|
|
454
493
|
#### Methods
|
|
455
494
|
|
|
456
495
|
##### captureStackTrace()
|
|
457
496
|
|
|
497
|
+
###### Call Signature
|
|
498
|
+
|
|
499
|
+
```ts
|
|
500
|
+
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:51
|
|
504
|
+
|
|
505
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
506
|
+
a string representing the location in the code at which
|
|
507
|
+
`Error.captureStackTrace()` was called.
|
|
508
|
+
|
|
509
|
+
```js
|
|
510
|
+
const myObject = {};
|
|
511
|
+
Error.captureStackTrace(myObject);
|
|
512
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
The first line of the trace will be prefixed with
|
|
516
|
+
`${myObject.name}: ${myObject.message}`.
|
|
517
|
+
|
|
518
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
519
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
520
|
+
generated stack trace.
|
|
521
|
+
|
|
522
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
523
|
+
details of error generation from the user. For instance:
|
|
524
|
+
|
|
525
|
+
```js
|
|
526
|
+
function a() {
|
|
527
|
+
b();
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function b() {
|
|
531
|
+
c();
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function c() {
|
|
535
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
536
|
+
const { stackTraceLimit } = Error;
|
|
537
|
+
Error.stackTraceLimit = 0;
|
|
538
|
+
const error = new Error();
|
|
539
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
540
|
+
|
|
541
|
+
// Capture the stack trace above function b
|
|
542
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
543
|
+
throw error;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
a();
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
###### Parameters
|
|
550
|
+
|
|
551
|
+
| Parameter | Type |
|
|
552
|
+
| ------ | ------ |
|
|
553
|
+
| `targetObject` | `object` |
|
|
554
|
+
| `constructorOpt?` | `Function` |
|
|
555
|
+
|
|
556
|
+
###### Returns
|
|
557
|
+
|
|
558
|
+
`void`
|
|
559
|
+
|
|
560
|
+
###### Inherited from
|
|
561
|
+
|
|
562
|
+
```ts
|
|
563
|
+
Error.captureStackTrace
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
###### Call Signature
|
|
567
|
+
|
|
458
568
|
```ts
|
|
459
569
|
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
460
570
|
```
|
|
461
571
|
|
|
462
|
-
Defined in: node\_modules/.pnpm/@types+node@
|
|
572
|
+
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52
|
|
463
573
|
|
|
464
574
|
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
465
575
|
a string representing the location in the code at which
|
|
@@ -524,11 +634,42 @@ Error.captureStackTrace
|
|
|
524
634
|
|
|
525
635
|
##### prepareStackTrace()
|
|
526
636
|
|
|
637
|
+
###### Call Signature
|
|
638
|
+
|
|
639
|
+
```ts
|
|
640
|
+
static prepareStackTrace(err, stackTraces): any;
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:55
|
|
644
|
+
|
|
645
|
+
###### Parameters
|
|
646
|
+
|
|
647
|
+
| Parameter | Type |
|
|
648
|
+
| ------ | ------ |
|
|
649
|
+
| `err` | `Error` |
|
|
650
|
+
| `stackTraces` | `CallSite`[] |
|
|
651
|
+
|
|
652
|
+
###### Returns
|
|
653
|
+
|
|
654
|
+
`any`
|
|
655
|
+
|
|
656
|
+
###### See
|
|
657
|
+
|
|
658
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
659
|
+
|
|
660
|
+
###### Inherited from
|
|
661
|
+
|
|
662
|
+
```ts
|
|
663
|
+
Error.prepareStackTrace
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
###### Call Signature
|
|
667
|
+
|
|
527
668
|
```ts
|
|
528
669
|
static prepareStackTrace(err, stackTraces): any;
|
|
529
670
|
```
|
|
530
671
|
|
|
531
|
-
Defined in: node\_modules/.pnpm/@types+node@
|
|
672
|
+
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56
|
|
532
673
|
|
|
533
674
|
###### Parameters
|
|
534
675
|
|
|
@@ -555,7 +696,7 @@ Error.prepareStackTrace
|
|
|
555
696
|
|
|
556
697
|
### TechnicalError
|
|
557
698
|
|
|
558
|
-
Defined in: [packages/core/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/
|
|
699
|
+
Defined in: [packages/core/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L7)
|
|
559
700
|
|
|
560
701
|
Error for technical/runtime failures that cannot be prevented by TypeScript.
|
|
561
702
|
|
|
@@ -574,7 +715,7 @@ and other runtime errors. This error is shared across core, worker, and client p
|
|
|
574
715
|
new TechnicalError(message, cause?): TechnicalError;
|
|
575
716
|
```
|
|
576
717
|
|
|
577
|
-
Defined in: [packages/core/src/errors.ts:8](https://github.com/btravers/amqp-contract/blob/
|
|
718
|
+
Defined in: [packages/core/src/errors.ts:8](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L8)
|
|
578
719
|
|
|
579
720
|
###### Parameters
|
|
580
721
|
|
|
@@ -597,21 +738,92 @@ Error.constructor
|
|
|
597
738
|
|
|
598
739
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
599
740
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
600
|
-
| <a id="cause-1"></a> `cause?` | `readonly` | `unknown` | - | `Error.cause` | [packages/core/src/errors.ts:10](https://github.com/btravers/amqp-contract/blob/
|
|
601
|
-
| <a id="message-1"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@
|
|
602
|
-
| <a id="name-1"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@
|
|
603
|
-
| <a id="stack-1"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@
|
|
604
|
-
| <a id="stacktracelimit-1"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | node\_modules/.pnpm/@types+node@25.
|
|
741
|
+
| <a id="cause-1"></a> `cause?` | `readonly` | `unknown` | - | `Error.cause` | [packages/core/src/errors.ts:10](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/errors.ts#L10) |
|
|
742
|
+
| <a id="message-1"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
|
|
743
|
+
| <a id="name-1"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
|
|
744
|
+
| <a id="stack-1"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
|
|
745
|
+
| <a id="stacktracelimit-1"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:67 |
|
|
605
746
|
|
|
606
747
|
#### Methods
|
|
607
748
|
|
|
608
749
|
##### captureStackTrace()
|
|
609
750
|
|
|
751
|
+
###### Call Signature
|
|
752
|
+
|
|
753
|
+
```ts
|
|
754
|
+
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:51
|
|
758
|
+
|
|
759
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
760
|
+
a string representing the location in the code at which
|
|
761
|
+
`Error.captureStackTrace()` was called.
|
|
762
|
+
|
|
763
|
+
```js
|
|
764
|
+
const myObject = {};
|
|
765
|
+
Error.captureStackTrace(myObject);
|
|
766
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
The first line of the trace will be prefixed with
|
|
770
|
+
`${myObject.name}: ${myObject.message}`.
|
|
771
|
+
|
|
772
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
773
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
774
|
+
generated stack trace.
|
|
775
|
+
|
|
776
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
777
|
+
details of error generation from the user. For instance:
|
|
778
|
+
|
|
779
|
+
```js
|
|
780
|
+
function a() {
|
|
781
|
+
b();
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function b() {
|
|
785
|
+
c();
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
function c() {
|
|
789
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
790
|
+
const { stackTraceLimit } = Error;
|
|
791
|
+
Error.stackTraceLimit = 0;
|
|
792
|
+
const error = new Error();
|
|
793
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
794
|
+
|
|
795
|
+
// Capture the stack trace above function b
|
|
796
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
797
|
+
throw error;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
a();
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
###### Parameters
|
|
804
|
+
|
|
805
|
+
| Parameter | Type |
|
|
806
|
+
| ------ | ------ |
|
|
807
|
+
| `targetObject` | `object` |
|
|
808
|
+
| `constructorOpt?` | `Function` |
|
|
809
|
+
|
|
810
|
+
###### Returns
|
|
811
|
+
|
|
812
|
+
`void`
|
|
813
|
+
|
|
814
|
+
###### Inherited from
|
|
815
|
+
|
|
816
|
+
```ts
|
|
817
|
+
Error.captureStackTrace
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
###### Call Signature
|
|
821
|
+
|
|
610
822
|
```ts
|
|
611
823
|
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
612
824
|
```
|
|
613
825
|
|
|
614
|
-
Defined in: node\_modules/.pnpm/@types+node@
|
|
826
|
+
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52
|
|
615
827
|
|
|
616
828
|
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
617
829
|
a string representing the location in the code at which
|
|
@@ -676,11 +888,42 @@ Error.captureStackTrace
|
|
|
676
888
|
|
|
677
889
|
##### prepareStackTrace()
|
|
678
890
|
|
|
891
|
+
###### Call Signature
|
|
892
|
+
|
|
893
|
+
```ts
|
|
894
|
+
static prepareStackTrace(err, stackTraces): any;
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:55
|
|
898
|
+
|
|
899
|
+
###### Parameters
|
|
900
|
+
|
|
901
|
+
| Parameter | Type |
|
|
902
|
+
| ------ | ------ |
|
|
903
|
+
| `err` | `Error` |
|
|
904
|
+
| `stackTraces` | `CallSite`[] |
|
|
905
|
+
|
|
906
|
+
###### Returns
|
|
907
|
+
|
|
908
|
+
`any`
|
|
909
|
+
|
|
910
|
+
###### See
|
|
911
|
+
|
|
912
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
913
|
+
|
|
914
|
+
###### Inherited from
|
|
915
|
+
|
|
916
|
+
```ts
|
|
917
|
+
Error.prepareStackTrace
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
###### Call Signature
|
|
921
|
+
|
|
679
922
|
```ts
|
|
680
923
|
static prepareStackTrace(err, stackTraces): any;
|
|
681
924
|
```
|
|
682
925
|
|
|
683
|
-
Defined in: node\_modules/.pnpm/@types+node@
|
|
926
|
+
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56
|
|
684
927
|
|
|
685
928
|
###### Parameters
|
|
686
929
|
|
|
@@ -711,7 +954,7 @@ Error.prepareStackTrace
|
|
|
711
954
|
type AmqpClientOptions = object;
|
|
712
955
|
```
|
|
713
956
|
|
|
714
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
957
|
+
Defined in: [packages/core/src/amqp-client.ts:47](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L47)
|
|
715
958
|
|
|
716
959
|
Options for creating an AMQP client.
|
|
717
960
|
|
|
@@ -719,19 +962,20 @@ Options for creating an AMQP client.
|
|
|
719
962
|
|
|
720
963
|
| Property | Type | Description | Defined in |
|
|
721
964
|
| ------ | ------ | ------ | ------ |
|
|
722
|
-
| <a id="channeloptions"></a> `channelOptions?` | `Partial`<`CreateChannelOpts`> | Optional channel configuration options. | [packages/core/src/amqp-client.ts:
|
|
723
|
-
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.). | [packages/core/src/amqp-client.ts:
|
|
724
|
-
| <a id="
|
|
965
|
+
| <a id="channeloptions"></a> `channelOptions?` | `Partial`<`CreateChannelOpts`> | Optional channel configuration options. | [packages/core/src/amqp-client.ts:50](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L50) |
|
|
966
|
+
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.). | [packages/core/src/amqp-client.ts:49](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L49) |
|
|
967
|
+
| <a id="connecttimeoutms"></a> `connectTimeoutMs?` | `number` | Maximum time in ms to wait for the channel to become ready in `waitForConnect`. If unset, waits forever (amqp-connection-manager retries indefinitely). | [packages/core/src/amqp-client.ts:51](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L51) |
|
|
968
|
+
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | AMQP broker URL(s). Multiple URLs provide failover support. | [packages/core/src/amqp-client.ts:48](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L48) |
|
|
725
969
|
|
|
726
970
|
***
|
|
727
971
|
|
|
728
|
-
### ConsumeCallback
|
|
972
|
+
### ConsumeCallback
|
|
729
973
|
|
|
730
974
|
```ts
|
|
731
975
|
type ConsumeCallback = (msg) => void | Promise<void>;
|
|
732
976
|
```
|
|
733
977
|
|
|
734
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
978
|
+
Defined in: [packages/core/src/amqp-client.ts:57](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L57)
|
|
735
979
|
|
|
736
980
|
Callback type for consuming messages.
|
|
737
981
|
|
|
@@ -747,13 +991,31 @@ Callback type for consuming messages.
|
|
|
747
991
|
|
|
748
992
|
***
|
|
749
993
|
|
|
994
|
+
### ConsumerOptions
|
|
995
|
+
|
|
996
|
+
```ts
|
|
997
|
+
type ConsumerOptions = Options.Consume & object;
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
Defined in: [packages/core/src/amqp-client.ts:70](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L70)
|
|
1001
|
+
|
|
1002
|
+
Consume options that extend amqplib's Options.Consume with optional prefetch support.
|
|
1003
|
+
|
|
1004
|
+
#### Type Declaration
|
|
1005
|
+
|
|
1006
|
+
| Name | Type | Description | Defined in |
|
|
1007
|
+
| ------ | ------ | ------ | ------ |
|
|
1008
|
+
| `prefetch?` | `number` | Number of messages to prefetch | [packages/core/src/amqp-client.ts:72](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L72) |
|
|
1009
|
+
|
|
1010
|
+
***
|
|
1011
|
+
|
|
750
1012
|
### Logger
|
|
751
1013
|
|
|
752
1014
|
```ts
|
|
753
1015
|
type Logger = object;
|
|
754
1016
|
```
|
|
755
1017
|
|
|
756
|
-
Defined in: [packages/core/src/logger.ts:30](https://github.com/btravers/amqp-contract/blob/
|
|
1018
|
+
Defined in: [packages/core/src/logger.ts:30](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L30)
|
|
757
1019
|
|
|
758
1020
|
Logger interface for amqp-contract packages.
|
|
759
1021
|
|
|
@@ -780,7 +1042,7 @@ const logger: Logger = {
|
|
|
780
1042
|
debug(message, context?): void;
|
|
781
1043
|
```
|
|
782
1044
|
|
|
783
|
-
Defined in: [packages/core/src/logger.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
1045
|
+
Defined in: [packages/core/src/logger.ts:36](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L36)
|
|
784
1046
|
|
|
785
1047
|
Log debug level messages
|
|
786
1048
|
|
|
@@ -801,7 +1063,7 @@ Log debug level messages
|
|
|
801
1063
|
error(message, context?): void;
|
|
802
1064
|
```
|
|
803
1065
|
|
|
804
|
-
Defined in: [packages/core/src/logger.ts:57](https://github.com/btravers/amqp-contract/blob/
|
|
1066
|
+
Defined in: [packages/core/src/logger.ts:57](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L57)
|
|
805
1067
|
|
|
806
1068
|
Log error level messages
|
|
807
1069
|
|
|
@@ -822,7 +1084,7 @@ Log error level messages
|
|
|
822
1084
|
info(message, context?): void;
|
|
823
1085
|
```
|
|
824
1086
|
|
|
825
|
-
Defined in: [packages/core/src/logger.ts:43](https://github.com/btravers/amqp-contract/blob/
|
|
1087
|
+
Defined in: [packages/core/src/logger.ts:43](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L43)
|
|
826
1088
|
|
|
827
1089
|
Log info level messages
|
|
828
1090
|
|
|
@@ -843,7 +1105,7 @@ Log info level messages
|
|
|
843
1105
|
warn(message, context?): void;
|
|
844
1106
|
```
|
|
845
1107
|
|
|
846
|
-
Defined in: [packages/core/src/logger.ts:50](https://github.com/btravers/amqp-contract/blob/
|
|
1108
|
+
Defined in: [packages/core/src/logger.ts:50](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L50)
|
|
847
1109
|
|
|
848
1110
|
Log warning level messages
|
|
849
1111
|
|
|
@@ -866,7 +1128,7 @@ Log warning level messages
|
|
|
866
1128
|
type LoggerContext = Record<string, unknown> & object;
|
|
867
1129
|
```
|
|
868
1130
|
|
|
869
|
-
Defined in: [packages/core/src/logger.ts:9](https://github.com/btravers/amqp-contract/blob/
|
|
1131
|
+
Defined in: [packages/core/src/logger.ts:9](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L9)
|
|
870
1132
|
|
|
871
1133
|
Context object for logger methods.
|
|
872
1134
|
|
|
@@ -877,7 +1139,25 @@ for common logging context properties.
|
|
|
877
1139
|
|
|
878
1140
|
| Name | Type | Defined in |
|
|
879
1141
|
| ------ | ------ | ------ |
|
|
880
|
-
| `error?` | `unknown` | [packages/core/src/logger.ts:10](https://github.com/btravers/amqp-contract/blob/
|
|
1142
|
+
| `error?` | `unknown` | [packages/core/src/logger.ts:10](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/logger.ts#L10) |
|
|
1143
|
+
|
|
1144
|
+
***
|
|
1145
|
+
|
|
1146
|
+
### PublishOptions
|
|
1147
|
+
|
|
1148
|
+
```ts
|
|
1149
|
+
type PublishOptions = Options.Publish & object;
|
|
1150
|
+
```
|
|
1151
|
+
|
|
1152
|
+
Defined in: [packages/core/src/amqp-client.ts:62](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L62)
|
|
1153
|
+
|
|
1154
|
+
Publish options that extend amqplib's Options.Publish with optional timeout support.
|
|
1155
|
+
|
|
1156
|
+
#### Type Declaration
|
|
1157
|
+
|
|
1158
|
+
| Name | Type | Description | Defined in |
|
|
1159
|
+
| ------ | ------ | ------ | ------ |
|
|
1160
|
+
| `timeout?` | `number` | Message will be rejected after timeout ms | [packages/core/src/amqp-client.ts:64](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/amqp-client.ts#L64) |
|
|
881
1161
|
|
|
882
1162
|
***
|
|
883
1163
|
|
|
@@ -887,7 +1167,7 @@ for common logging context properties.
|
|
|
887
1167
|
type TelemetryProvider = object;
|
|
888
1168
|
```
|
|
889
1169
|
|
|
890
|
-
Defined in: [packages/core/src/telemetry.ts:53](https://github.com/btravers/amqp-contract/blob/
|
|
1170
|
+
Defined in: [packages/core/src/telemetry.ts:53](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L53)
|
|
891
1171
|
|
|
892
1172
|
Telemetry provider for AMQP operations.
|
|
893
1173
|
Uses lazy loading to gracefully handle cases where OpenTelemetry is not installed.
|
|
@@ -896,11 +1176,11 @@ Uses lazy loading to gracefully handle cases where OpenTelemetry is not installe
|
|
|
896
1176
|
|
|
897
1177
|
| Property | Type | Description | Defined in |
|
|
898
1178
|
| ------ | ------ | ------ | ------ |
|
|
899
|
-
| <a id="getconsumecounter"></a> `getConsumeCounter` | () => `Counter` \| `undefined` | Get a counter for messages consumed. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:70](https://github.com/btravers/amqp-contract/blob/
|
|
900
|
-
| <a id="getconsumelatencyhistogram"></a> `getConsumeLatencyHistogram` | () => `Histogram` \| `undefined` | Get a histogram for consume/process latency. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:82](https://github.com/btravers/amqp-contract/blob/
|
|
901
|
-
| <a id="getpublishcounter"></a> `getPublishCounter` | () => `Counter` \| `undefined` | Get a counter for messages published. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:64](https://github.com/btravers/amqp-contract/blob/
|
|
902
|
-
| <a id="getpublishlatencyhistogram"></a> `getPublishLatencyHistogram` | () => `Histogram` \| `undefined` | Get a histogram for publish latency. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:76](https://github.com/btravers/amqp-contract/blob/
|
|
903
|
-
| <a id="gettracer"></a> `getTracer` | () => `Tracer` \| `undefined` | Get a tracer instance for creating spans. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:58](https://github.com/btravers/amqp-contract/blob/
|
|
1179
|
+
| <a id="getconsumecounter"></a> `getConsumeCounter` | () => `Counter` \| `undefined` | Get a counter for messages consumed. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:70](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L70) |
|
|
1180
|
+
| <a id="getconsumelatencyhistogram"></a> `getConsumeLatencyHistogram` | () => `Histogram` \| `undefined` | Get a histogram for consume/process latency. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:82](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L82) |
|
|
1181
|
+
| <a id="getpublishcounter"></a> `getPublishCounter` | () => `Counter` \| `undefined` | Get a counter for messages published. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:64](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L64) |
|
|
1182
|
+
| <a id="getpublishlatencyhistogram"></a> `getPublishLatencyHistogram` | () => `Histogram` \| `undefined` | Get a histogram for publish latency. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:76](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L76) |
|
|
1183
|
+
| <a id="gettracer"></a> `getTracer` | () => `Tracer` \| `undefined` | Get a tracer instance for creating spans. Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:58](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L58) |
|
|
904
1184
|
|
|
905
1185
|
## Variables
|
|
906
1186
|
|
|
@@ -910,7 +1190,7 @@ Uses lazy loading to gracefully handle cases where OpenTelemetry is not installe
|
|
|
910
1190
|
const defaultTelemetryProvider: TelemetryProvider;
|
|
911
1191
|
```
|
|
912
1192
|
|
|
913
|
-
Defined in: [packages/core/src/telemetry.ts:194](https://github.com/btravers/amqp-contract/blob/
|
|
1193
|
+
Defined in: [packages/core/src/telemetry.ts:194](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L194)
|
|
914
1194
|
|
|
915
1195
|
Default telemetry provider that uses OpenTelemetry API if available.
|
|
916
1196
|
|
|
@@ -922,7 +1202,7 @@ Default telemetry provider that uses OpenTelemetry API if available.
|
|
|
922
1202
|
const MessagingSemanticConventions: object;
|
|
923
1203
|
```
|
|
924
1204
|
|
|
925
|
-
Defined in: [packages/core/src/telemetry.ts:25](https://github.com/btravers/amqp-contract/blob/
|
|
1205
|
+
Defined in: [packages/core/src/telemetry.ts:25](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L25)
|
|
926
1206
|
|
|
927
1207
|
Semantic conventions for AMQP messaging following OpenTelemetry standards.
|
|
928
1208
|
|
|
@@ -930,20 +1210,20 @@ Semantic conventions for AMQP messaging following OpenTelemetry standards.
|
|
|
930
1210
|
|
|
931
1211
|
| Name | Type | Default value | Defined in |
|
|
932
1212
|
| ------ | ------ | ------ | ------ |
|
|
933
|
-
| <a id="property-amqp_consumer_name"></a> `AMQP_CONSUMER_NAME` | `"amqp.consumer.name"` | `"amqp.consumer.name"` | [packages/core/src/telemetry.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
934
|
-
| <a id="property-amqp_publisher_name"></a> `AMQP_PUBLISHER_NAME` | `"amqp.publisher.name"` | `"amqp.publisher.name"` | [packages/core/src/telemetry.ts:35](https://github.com/btravers/amqp-contract/blob/
|
|
935
|
-
| <a id="property-error_type"></a> `ERROR_TYPE` | `"error.type"` | `"error.type"` | [packages/core/src/telemetry.ts:39](https://github.com/btravers/amqp-contract/blob/
|
|
936
|
-
| <a id="property-messaging_destination"></a> `MESSAGING_DESTINATION` | `"messaging.destination.name"` | `"messaging.destination.name"` | [packages/core/src/telemetry.ts:28](https://github.com/btravers/amqp-contract/blob/
|
|
937
|
-
| <a id="property-messaging_destination_kind"></a> `MESSAGING_DESTINATION_KIND` | `"messaging.destination.kind"` | `"messaging.destination.kind"` | [packages/core/src/telemetry.ts:29](https://github.com/btravers/amqp-contract/blob/
|
|
938
|
-
| <a id="property-messaging_destination_kind_exchange"></a> `MESSAGING_DESTINATION_KIND_EXCHANGE` | `"exchange"` | `"exchange"` | [packages/core/src/telemetry.ts:43](https://github.com/btravers/amqp-contract/blob/
|
|
939
|
-
| <a id="property-messaging_destination_kind_queue"></a> `MESSAGING_DESTINATION_KIND_QUEUE` | `"queue"` | `"queue"` | [packages/core/src/telemetry.ts:44](https://github.com/btravers/amqp-contract/blob/
|
|
940
|
-
| <a id="property-messaging_operation"></a> `MESSAGING_OPERATION` | `"messaging.operation"` | `"messaging.operation"` | [packages/core/src/telemetry.ts:30](https://github.com/btravers/amqp-contract/blob/
|
|
941
|
-
| <a id="property-messaging_operation_process"></a> `MESSAGING_OPERATION_PROCESS` | `"process"` | `"process"` | [packages/core/src/telemetry.ts:46](https://github.com/btravers/amqp-contract/blob/
|
|
942
|
-
| <a id="property-messaging_operation_publish"></a> `MESSAGING_OPERATION_PUBLISH` | `"publish"` | `"publish"` | [packages/core/src/telemetry.ts:45](https://github.com/btravers/amqp-contract/blob/
|
|
943
|
-
| <a id="property-messaging_rabbitmq_message_delivery_tag"></a> `MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG` | `"messaging.rabbitmq.message.delivery_tag"` | `"messaging.rabbitmq.message.delivery_tag"` | [packages/core/src/telemetry.ts:34](https://github.com/btravers/amqp-contract/blob/
|
|
944
|
-
| <a id="property-messaging_rabbitmq_routing_key"></a> `MESSAGING_RABBITMQ_ROUTING_KEY` | `"messaging.rabbitmq.destination.routing_key"` | `"messaging.rabbitmq.destination.routing_key"` | [packages/core/src/telemetry.ts:33](https://github.com/btravers/amqp-contract/blob/
|
|
945
|
-
| <a id="property-messaging_system"></a> `MESSAGING_SYSTEM` | `"messaging.system"` | `"messaging.system"` | [packages/core/src/telemetry.ts:27](https://github.com/btravers/amqp-contract/blob/
|
|
946
|
-
| <a id="property-messaging_system_rabbitmq"></a> `MESSAGING_SYSTEM_RABBITMQ` | `"rabbitmq"` | `"rabbitmq"` | [packages/core/src/telemetry.ts:42](https://github.com/btravers/amqp-contract/blob/
|
|
1213
|
+
| <a id="property-amqp_consumer_name"></a> `AMQP_CONSUMER_NAME` | `"amqp.consumer.name"` | `"amqp.consumer.name"` | [packages/core/src/telemetry.ts:36](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L36) |
|
|
1214
|
+
| <a id="property-amqp_publisher_name"></a> `AMQP_PUBLISHER_NAME` | `"amqp.publisher.name"` | `"amqp.publisher.name"` | [packages/core/src/telemetry.ts:35](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L35) |
|
|
1215
|
+
| <a id="property-error_type"></a> `ERROR_TYPE` | `"error.type"` | `"error.type"` | [packages/core/src/telemetry.ts:39](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L39) |
|
|
1216
|
+
| <a id="property-messaging_destination"></a> `MESSAGING_DESTINATION` | `"messaging.destination.name"` | `"messaging.destination.name"` | [packages/core/src/telemetry.ts:28](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L28) |
|
|
1217
|
+
| <a id="property-messaging_destination_kind"></a> `MESSAGING_DESTINATION_KIND` | `"messaging.destination.kind"` | `"messaging.destination.kind"` | [packages/core/src/telemetry.ts:29](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L29) |
|
|
1218
|
+
| <a id="property-messaging_destination_kind_exchange"></a> `MESSAGING_DESTINATION_KIND_EXCHANGE` | `"exchange"` | `"exchange"` | [packages/core/src/telemetry.ts:43](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L43) |
|
|
1219
|
+
| <a id="property-messaging_destination_kind_queue"></a> `MESSAGING_DESTINATION_KIND_QUEUE` | `"queue"` | `"queue"` | [packages/core/src/telemetry.ts:44](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L44) |
|
|
1220
|
+
| <a id="property-messaging_operation"></a> `MESSAGING_OPERATION` | `"messaging.operation"` | `"messaging.operation"` | [packages/core/src/telemetry.ts:30](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L30) |
|
|
1221
|
+
| <a id="property-messaging_operation_process"></a> `MESSAGING_OPERATION_PROCESS` | `"process"` | `"process"` | [packages/core/src/telemetry.ts:46](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L46) |
|
|
1222
|
+
| <a id="property-messaging_operation_publish"></a> `MESSAGING_OPERATION_PUBLISH` | `"publish"` | `"publish"` | [packages/core/src/telemetry.ts:45](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L45) |
|
|
1223
|
+
| <a id="property-messaging_rabbitmq_message_delivery_tag"></a> `MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG` | `"messaging.rabbitmq.message.delivery_tag"` | `"messaging.rabbitmq.message.delivery_tag"` | [packages/core/src/telemetry.ts:34](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L34) |
|
|
1224
|
+
| <a id="property-messaging_rabbitmq_routing_key"></a> `MESSAGING_RABBITMQ_ROUTING_KEY` | `"messaging.rabbitmq.destination.routing_key"` | `"messaging.rabbitmq.destination.routing_key"` | [packages/core/src/telemetry.ts:33](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L33) |
|
|
1225
|
+
| <a id="property-messaging_system"></a> `MESSAGING_SYSTEM` | `"messaging.system"` | `"messaging.system"` | [packages/core/src/telemetry.ts:27](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L27) |
|
|
1226
|
+
| <a id="property-messaging_system_rabbitmq"></a> `MESSAGING_SYSTEM_RABBITMQ` | `"rabbitmq"` | `"rabbitmq"` | [packages/core/src/telemetry.ts:42](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L42) |
|
|
947
1227
|
|
|
948
1228
|
#### See
|
|
949
1229
|
|
|
@@ -957,7 +1237,7 @@ https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/
|
|
|
957
1237
|
function endSpanError(span, error): void;
|
|
958
1238
|
```
|
|
959
1239
|
|
|
960
|
-
Defined in: [packages/core/src/telemetry.ts:288](https://github.com/btravers/amqp-contract/blob/
|
|
1240
|
+
Defined in: [packages/core/src/telemetry.ts:288](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L288)
|
|
961
1241
|
|
|
962
1242
|
End a span with error status.
|
|
963
1243
|
|
|
@@ -980,7 +1260,7 @@ End a span with error status.
|
|
|
980
1260
|
function endSpanSuccess(span): void;
|
|
981
1261
|
```
|
|
982
1262
|
|
|
983
|
-
Defined in: [packages/core/src/telemetry.ts:273](https://github.com/btravers/amqp-contract/blob/
|
|
1263
|
+
Defined in: [packages/core/src/telemetry.ts:273](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L273)
|
|
984
1264
|
|
|
985
1265
|
End a span with success status.
|
|
986
1266
|
|
|
@@ -1007,7 +1287,7 @@ function recordConsumeMetric(
|
|
|
1007
1287
|
durationMs): void;
|
|
1008
1288
|
```
|
|
1009
1289
|
|
|
1010
|
-
Defined in: [packages/core/src/telemetry.ts:332](https://github.com/btravers/amqp-contract/blob/
|
|
1290
|
+
Defined in: [packages/core/src/telemetry.ts:332](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L332)
|
|
1011
1291
|
|
|
1012
1292
|
Record a consume metric.
|
|
1013
1293
|
|
|
@@ -1038,7 +1318,7 @@ function recordPublishMetric(
|
|
|
1038
1318
|
durationMs): void;
|
|
1039
1319
|
```
|
|
1040
1320
|
|
|
1041
|
-
Defined in: [packages/core/src/telemetry.ts:305](https://github.com/btravers/amqp-contract/blob/
|
|
1321
|
+
Defined in: [packages/core/src/telemetry.ts:305](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L305)
|
|
1042
1322
|
|
|
1043
1323
|
Record a publish metric.
|
|
1044
1324
|
|
|
@@ -1064,7 +1344,7 @@ Record a publish metric.
|
|
|
1064
1344
|
function setupAmqpTopology(channel, contract): Promise<void>;
|
|
1065
1345
|
```
|
|
1066
1346
|
|
|
1067
|
-
Defined in: [packages/core/src/setup.ts:26](https://github.com/btravers/amqp-contract/blob/
|
|
1347
|
+
Defined in: [packages/core/src/setup.ts:26](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/setup.ts#L26)
|
|
1068
1348
|
|
|
1069
1349
|
Setup AMQP topology (exchanges, queues, and bindings) from a contract definition.
|
|
1070
1350
|
|
|
@@ -1112,7 +1392,7 @@ function startConsumeSpan(
|
|
|
1112
1392
|
attributes?): Span | undefined;
|
|
1113
1393
|
```
|
|
1114
1394
|
|
|
1115
|
-
Defined in: [packages/core/src/telemetry.ts:241](https://github.com/btravers/amqp-contract/blob/
|
|
1395
|
+
Defined in: [packages/core/src/telemetry.ts:241](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L241)
|
|
1116
1396
|
|
|
1117
1397
|
Create a span for a consume/process operation.
|
|
1118
1398
|
Returns undefined if OpenTelemetry is not available.
|
|
@@ -1142,7 +1422,7 @@ function startPublishSpan(
|
|
|
1142
1422
|
attributes?): Span | undefined;
|
|
1143
1423
|
```
|
|
1144
1424
|
|
|
1145
|
-
Defined in: [packages/core/src/telemetry.ts:206](https://github.com/btravers/amqp-contract/blob/
|
|
1425
|
+
Defined in: [packages/core/src/telemetry.ts:206](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/core/src/telemetry.ts#L206)
|
|
1146
1426
|
|
|
1147
1427
|
Create a span for a publish operation.
|
|
1148
1428
|
Returns undefined if OpenTelemetry is not available.
|