@amqp-contract/core 0.25.0 → 1.0.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 +6 -6
- package/dist/index.cjs +51 -45
- package/dist/index.d.cts +35 -20
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +35 -20
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +50 -44
- package/dist/index.mjs.map +1 -1
- package/docs/index.md +136 -509
- package/package.json +16 -12
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:141](https://github.com/
|
|
11
|
+
Defined in: [packages/core/src/amqp-client.ts:141](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L141)
|
|
12
12
|
|
|
13
13
|
AMQP client that manages connections and channels with automatic topology setup.
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ This class handles:
|
|
|
18
18
|
- Automatic AMQP topology setup (exchanges, queues, bindings) from contract
|
|
19
19
|
- Channel creation with JSON serialization enabled by default
|
|
20
20
|
|
|
21
|
-
All operations return `
|
|
21
|
+
All operations return `AsyncResult<T, TechnicalError>` for consistent error handling.
|
|
22
22
|
|
|
23
23
|
#### Example
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ const client = new AmqpClient(contract, {
|
|
|
28
28
|
connectionOptions: { heartbeatIntervalInSeconds: 30 }
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
// Wait for connection (
|
|
31
|
+
// Wait for connection (AsyncResult is thenable)
|
|
32
32
|
await client.waitForConnect();
|
|
33
33
|
|
|
34
34
|
// Publish a message
|
|
@@ -46,7 +46,7 @@ await client.close();
|
|
|
46
46
|
new AmqpClient(contract, options): AmqpClient;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Defined in: [packages/core/src/amqp-client.ts:169](https://github.com/
|
|
49
|
+
Defined in: [packages/core/src/amqp-client.ts:169](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L169)
|
|
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:426](https://github.com/
|
|
77
|
+
Defined in: [packages/core/src/amqp-client.ts:426](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L426)
|
|
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:448](https://github.com/
|
|
98
|
+
Defined in: [packages/core/src/amqp-client.ts:448](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L448)
|
|
99
99
|
|
|
100
100
|
Add a setup function to be called when the channel is created or reconnected.
|
|
101
101
|
|
|
@@ -114,10 +114,10 @@ This is useful for setting up channel-level configuration like prefetch.
|
|
|
114
114
|
##### cancel()
|
|
115
115
|
|
|
116
116
|
```ts
|
|
117
|
-
cancel(consumerTag):
|
|
117
|
+
cancel(consumerTag): AsyncResult<void, TechnicalError>;
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Defined in: [packages/core/src/amqp-client.ts:395](https://github.com/
|
|
120
|
+
Defined in: [packages/core/src/amqp-client.ts:395](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L395)
|
|
121
121
|
|
|
122
122
|
Cancel a consumer by its consumer tag.
|
|
123
123
|
|
|
@@ -129,15 +129,15 @@ Cancel a consumer by its consumer tag.
|
|
|
129
129
|
|
|
130
130
|
###### Returns
|
|
131
131
|
|
|
132
|
-
`
|
|
132
|
+
`AsyncResult`<`void`, [`TechnicalError`](#technicalerror)>
|
|
133
133
|
|
|
134
134
|
##### close()
|
|
135
135
|
|
|
136
136
|
```ts
|
|
137
|
-
close():
|
|
137
|
+
close(): AsyncResult<void, TechnicalError>;
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
Defined in: [packages/core/src/amqp-client.ts:478](https://github.com/
|
|
140
|
+
Defined in: [packages/core/src/amqp-client.ts:478](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L478)
|
|
141
141
|
|
|
142
142
|
Close the channel and release the connection reference.
|
|
143
143
|
|
|
@@ -151,7 +151,7 @@ errors are wrapped in an AggregateError.
|
|
|
151
151
|
|
|
152
152
|
###### Returns
|
|
153
153
|
|
|
154
|
-
`
|
|
154
|
+
`AsyncResult`<`void`, [`TechnicalError`](#technicalerror)>
|
|
155
155
|
|
|
156
156
|
##### consume()
|
|
157
157
|
|
|
@@ -159,10 +159,10 @@ errors are wrapped in an AggregateError.
|
|
|
159
159
|
consume(
|
|
160
160
|
queue,
|
|
161
161
|
callback,
|
|
162
|
-
options?):
|
|
162
|
+
options?): AsyncResult<string, TechnicalError>;
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
Defined in: [packages/core/src/amqp-client.ts:321](https://github.com/
|
|
165
|
+
Defined in: [packages/core/src/amqp-client.ts:321](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L321)
|
|
166
166
|
|
|
167
167
|
Start consuming messages from a queue.
|
|
168
168
|
|
|
@@ -188,9 +188,9 @@ in would just travel as a no-op key-value pair on the consume frame.
|
|
|
188
188
|
|
|
189
189
|
###### Returns
|
|
190
190
|
|
|
191
|
-
`
|
|
191
|
+
`AsyncResult`<`string`, [`TechnicalError`](#technicalerror)>
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
AsyncResult resolving to the consumer tag.
|
|
194
194
|
|
|
195
195
|
##### getConnection()
|
|
196
196
|
|
|
@@ -198,7 +198,7 @@ ResultAsync resolving to the consumer tag.
|
|
|
198
198
|
getConnection(): IAmqpConnectionManager;
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
Defined in: [packages/core/src/amqp-client.ts:224](https://github.com/
|
|
201
|
+
Defined in: [packages/core/src/amqp-client.ts:224](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L224)
|
|
202
202
|
|
|
203
203
|
Get the underlying connection manager
|
|
204
204
|
|
|
@@ -221,7 +221,7 @@ nack(
|
|
|
221
221
|
requeue?): void;
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
Defined in: [packages/core/src/amqp-client.ts:437](https://github.com/
|
|
224
|
+
Defined in: [packages/core/src/amqp-client.ts:437](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L437)
|
|
225
225
|
|
|
226
226
|
Negative acknowledge a message.
|
|
227
227
|
|
|
@@ -243,7 +243,7 @@ Negative acknowledge a message.
|
|
|
243
243
|
on(event, listener): void;
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
Defined in: [packages/core/src/amqp-client.ts:463](https://github.com/
|
|
246
|
+
Defined in: [packages/core/src/amqp-client.ts:463](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L463)
|
|
247
247
|
|
|
248
248
|
Register an event listener on the channel wrapper.
|
|
249
249
|
|
|
@@ -270,10 +270,10 @@ publish(
|
|
|
270
270
|
exchange,
|
|
271
271
|
routingKey,
|
|
272
272
|
content,
|
|
273
|
-
options?):
|
|
273
|
+
options?): AsyncResult<boolean, TechnicalError>;
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
Defined in: [packages/core/src/amqp-client.ts:276](https://github.com/
|
|
276
|
+
Defined in: [packages/core/src/amqp-client.ts:276](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L276)
|
|
277
277
|
|
|
278
278
|
Publish a message to an exchange.
|
|
279
279
|
|
|
@@ -288,9 +288,9 @@ Publish a message to an exchange.
|
|
|
288
288
|
|
|
289
289
|
###### Returns
|
|
290
290
|
|
|
291
|
-
`
|
|
291
|
+
`AsyncResult`<`boolean`, [`TechnicalError`](#technicalerror)>
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
AsyncResult resolving to `true` if the message was sent, `false` if the channel buffer is full.
|
|
294
294
|
|
|
295
295
|
##### sendToQueue()
|
|
296
296
|
|
|
@@ -298,10 +298,10 @@ ResultAsync resolving to `true` if the message was sent, `false` if the channel
|
|
|
298
298
|
sendToQueue(
|
|
299
299
|
queue,
|
|
300
300
|
content,
|
|
301
|
-
options?):
|
|
301
|
+
options?): AsyncResult<boolean, TechnicalError>;
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
-
Defined in: [packages/core/src/amqp-client.ts:293](https://github.com/
|
|
304
|
+
Defined in: [packages/core/src/amqp-client.ts:293](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L293)
|
|
305
305
|
|
|
306
306
|
Publish a message directly to a queue.
|
|
307
307
|
|
|
@@ -315,22 +315,22 @@ Publish a message directly to a queue.
|
|
|
315
315
|
|
|
316
316
|
###### Returns
|
|
317
317
|
|
|
318
|
-
`
|
|
318
|
+
`AsyncResult`<`boolean`, [`TechnicalError`](#technicalerror)>
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
AsyncResult resolving to `true` if the message was sent, `false` if the channel buffer is full.
|
|
321
321
|
|
|
322
322
|
##### waitForConnect()
|
|
323
323
|
|
|
324
324
|
```ts
|
|
325
|
-
waitForConnect():
|
|
325
|
+
waitForConnect(): AsyncResult<void, TechnicalError>;
|
|
326
326
|
```
|
|
327
327
|
|
|
328
|
-
Defined in: [packages/core/src/amqp-client.ts:242](https://github.com/
|
|
328
|
+
Defined in: [packages/core/src/amqp-client.ts:242](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L242)
|
|
329
329
|
|
|
330
330
|
Wait for the channel to be connected and ready.
|
|
331
331
|
|
|
332
332
|
If `connectTimeoutMs` was provided in the constructor options, the returned
|
|
333
|
-
|
|
333
|
+
AsyncResult resolves to `err(TechnicalError)` once the timeout elapses.
|
|
334
334
|
Without a timeout, this waits forever — amqp-connection-manager retries
|
|
335
335
|
connections indefinitely and never errors on its own.
|
|
336
336
|
|
|
@@ -342,30 +342,40 @@ automatically. The typed factories handle this cleanup for you.
|
|
|
342
342
|
|
|
343
343
|
###### Returns
|
|
344
344
|
|
|
345
|
-
`
|
|
345
|
+
`AsyncResult`<`void`, [`TechnicalError`](#technicalerror)>
|
|
346
346
|
|
|
347
347
|
***
|
|
348
348
|
|
|
349
349
|
### MessageValidationError
|
|
350
350
|
|
|
351
|
-
Defined in: [packages/core/src/errors.ts:
|
|
351
|
+
Defined in: [packages/core/src/errors.ts:38](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/errors.ts#L38)
|
|
352
352
|
|
|
353
353
|
Error thrown when message validation fails (payload or headers).
|
|
354
354
|
|
|
355
355
|
Used by both the client (publish-time payload validation) and the worker
|
|
356
|
-
(consume-time payload and headers validation).
|
|
356
|
+
(consume-time payload and headers validation). Carries a `_tag` of
|
|
357
|
+
`"@amqp-contract/MessageValidationError"` (namespaced to avoid collisions);
|
|
358
|
+
the `Error.name` is kept bare (`"MessageValidationError"`).
|
|
357
359
|
|
|
358
360
|
#### Param
|
|
359
361
|
|
|
362
|
+
**source**
|
|
363
|
+
|
|
360
364
|
The name of the publisher or consumer that triggered the validation
|
|
361
365
|
|
|
362
366
|
#### Param
|
|
363
367
|
|
|
368
|
+
**issues**
|
|
369
|
+
|
|
364
370
|
The validation issues from the Standard Schema validation
|
|
365
371
|
|
|
366
372
|
#### Extends
|
|
367
373
|
|
|
368
|
-
- `
|
|
374
|
+
- `TaggedErrorInstance`<`"@amqp-contract/MessageValidationError"`, \{
|
|
375
|
+
`issues`: `unknown`;
|
|
376
|
+
`message`: `string`;
|
|
377
|
+
`source`: `string`;
|
|
378
|
+
\}>
|
|
369
379
|
|
|
370
380
|
#### Constructors
|
|
371
381
|
|
|
@@ -375,7 +385,7 @@ The validation issues from the Standard Schema validation
|
|
|
375
385
|
new MessageValidationError(source, issues): MessageValidationError;
|
|
376
386
|
```
|
|
377
387
|
|
|
378
|
-
Defined in: [packages/core/src/errors.ts:
|
|
388
|
+
Defined in: [packages/core/src/errors.ts:45](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/errors.ts#L45)
|
|
379
389
|
|
|
380
390
|
###### Parameters
|
|
381
391
|
|
|
@@ -391,237 +401,51 @@ Defined in: [packages/core/src/errors.ts:34](https://github.com/btravers/amqp-co
|
|
|
391
401
|
###### Overrides
|
|
392
402
|
|
|
393
403
|
```ts
|
|
394
|
-
|
|
404
|
+
TaggedError("@amqp-contract/MessageValidationError", {
|
|
405
|
+
name: "MessageValidationError",
|
|
406
|
+
})<{
|
|
407
|
+
message: string;
|
|
408
|
+
source: string;
|
|
409
|
+
issues: unknown;
|
|
410
|
+
}>.constructor
|
|
395
411
|
```
|
|
396
412
|
|
|
397
413
|
#### Properties
|
|
398
414
|
|
|
399
|
-
| Property | Modifier | Type |
|
|
400
|
-
| ------ | ------ | ------ | ------ | ------ |
|
|
401
|
-
| <a id="
|
|
402
|
-
| <a id="
|
|
403
|
-
| <a id="
|
|
404
|
-
| <a id="
|
|
405
|
-
| <a id="
|
|
406
|
-
| <a id="
|
|
407
|
-
| <a id="
|
|
408
|
-
|
|
409
|
-
#### Methods
|
|
410
|
-
|
|
411
|
-
##### captureStackTrace()
|
|
412
|
-
|
|
413
|
-
###### Call Signature
|
|
414
|
-
|
|
415
|
-
```ts
|
|
416
|
-
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:51
|
|
420
|
-
|
|
421
|
-
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
422
|
-
a string representing the location in the code at which
|
|
423
|
-
`Error.captureStackTrace()` was called.
|
|
424
|
-
|
|
425
|
-
```js
|
|
426
|
-
const myObject = {};
|
|
427
|
-
Error.captureStackTrace(myObject);
|
|
428
|
-
myObject.stack; // Similar to `new Error().stack`
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
The first line of the trace will be prefixed with
|
|
432
|
-
`${myObject.name}: ${myObject.message}`.
|
|
433
|
-
|
|
434
|
-
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
435
|
-
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
436
|
-
generated stack trace.
|
|
437
|
-
|
|
438
|
-
The `constructorOpt` argument is useful for hiding implementation
|
|
439
|
-
details of error generation from the user. For instance:
|
|
440
|
-
|
|
441
|
-
```js
|
|
442
|
-
function a() {
|
|
443
|
-
b();
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
function b() {
|
|
447
|
-
c();
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
function c() {
|
|
451
|
-
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
452
|
-
const { stackTraceLimit } = Error;
|
|
453
|
-
Error.stackTraceLimit = 0;
|
|
454
|
-
const error = new Error();
|
|
455
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
456
|
-
|
|
457
|
-
// Capture the stack trace above function b
|
|
458
|
-
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
459
|
-
throw error;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
a();
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
###### Parameters
|
|
466
|
-
|
|
467
|
-
| Parameter | Type |
|
|
468
|
-
| ------ | ------ |
|
|
469
|
-
| `targetObject` | `object` |
|
|
470
|
-
| `constructorOpt?` | `Function` |
|
|
471
|
-
|
|
472
|
-
###### Returns
|
|
473
|
-
|
|
474
|
-
`void`
|
|
475
|
-
|
|
476
|
-
###### Inherited from
|
|
477
|
-
|
|
478
|
-
```ts
|
|
479
|
-
Error.captureStackTrace
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
###### Call Signature
|
|
483
|
-
|
|
484
|
-
```ts
|
|
485
|
-
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52
|
|
489
|
-
|
|
490
|
-
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
491
|
-
a string representing the location in the code at which
|
|
492
|
-
`Error.captureStackTrace()` was called.
|
|
493
|
-
|
|
494
|
-
```js
|
|
495
|
-
const myObject = {};
|
|
496
|
-
Error.captureStackTrace(myObject);
|
|
497
|
-
myObject.stack; // Similar to `new Error().stack`
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
The first line of the trace will be prefixed with
|
|
501
|
-
`${myObject.name}: ${myObject.message}`.
|
|
502
|
-
|
|
503
|
-
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
504
|
-
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
505
|
-
generated stack trace.
|
|
506
|
-
|
|
507
|
-
The `constructorOpt` argument is useful for hiding implementation
|
|
508
|
-
details of error generation from the user. For instance:
|
|
509
|
-
|
|
510
|
-
```js
|
|
511
|
-
function a() {
|
|
512
|
-
b();
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
function b() {
|
|
516
|
-
c();
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
function c() {
|
|
520
|
-
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
521
|
-
const { stackTraceLimit } = Error;
|
|
522
|
-
Error.stackTraceLimit = 0;
|
|
523
|
-
const error = new Error();
|
|
524
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
525
|
-
|
|
526
|
-
// Capture the stack trace above function b
|
|
527
|
-
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
528
|
-
throw error;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
a();
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
###### Parameters
|
|
535
|
-
|
|
536
|
-
| Parameter | Type |
|
|
537
|
-
| ------ | ------ |
|
|
538
|
-
| `targetObject` | `object` |
|
|
539
|
-
| `constructorOpt?` | `Function` |
|
|
540
|
-
|
|
541
|
-
###### Returns
|
|
542
|
-
|
|
543
|
-
`void`
|
|
544
|
-
|
|
545
|
-
###### Inherited from
|
|
546
|
-
|
|
547
|
-
```ts
|
|
548
|
-
Error.captureStackTrace
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
##### prepareStackTrace()
|
|
552
|
-
|
|
553
|
-
###### Call Signature
|
|
554
|
-
|
|
555
|
-
```ts
|
|
556
|
-
static prepareStackTrace(err, stackTraces): any;
|
|
557
|
-
```
|
|
558
|
-
|
|
559
|
-
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:55
|
|
560
|
-
|
|
561
|
-
###### Parameters
|
|
562
|
-
|
|
563
|
-
| Parameter | Type |
|
|
564
|
-
| ------ | ------ |
|
|
565
|
-
| `err` | `Error` |
|
|
566
|
-
| `stackTraces` | `CallSite`[] |
|
|
567
|
-
|
|
568
|
-
###### Returns
|
|
569
|
-
|
|
570
|
-
`any`
|
|
571
|
-
|
|
572
|
-
###### See
|
|
573
|
-
|
|
574
|
-
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
575
|
-
|
|
576
|
-
###### Inherited from
|
|
577
|
-
|
|
578
|
-
```ts
|
|
579
|
-
Error.prepareStackTrace
|
|
580
|
-
```
|
|
581
|
-
|
|
582
|
-
###### Call Signature
|
|
583
|
-
|
|
584
|
-
```ts
|
|
585
|
-
static prepareStackTrace(err, stackTraces): any;
|
|
586
|
-
```
|
|
587
|
-
|
|
588
|
-
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56
|
|
589
|
-
|
|
590
|
-
###### Parameters
|
|
591
|
-
|
|
592
|
-
| Parameter | Type |
|
|
593
|
-
| ------ | ------ |
|
|
594
|
-
| `err` | `Error` |
|
|
595
|
-
| `stackTraces` | `CallSite`[] |
|
|
596
|
-
|
|
597
|
-
###### Returns
|
|
598
|
-
|
|
599
|
-
`any`
|
|
600
|
-
|
|
601
|
-
###### See
|
|
602
|
-
|
|
603
|
-
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
604
|
-
|
|
605
|
-
###### Inherited from
|
|
606
|
-
|
|
607
|
-
```ts
|
|
608
|
-
Error.prepareStackTrace
|
|
609
|
-
```
|
|
415
|
+
| Property | Modifier | Type | Inherited from | Defined in |
|
|
416
|
+
| ------ | ------ | ------ | ------ | ------ |
|
|
417
|
+
| <a id="_tag"></a> `_tag` | `readonly` | `"@amqp-contract/MessageValidationError"` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", })._tag` | node\_modules/.pnpm/unthrown@0.2.0/node\_modules/unthrown/dist/index.d.mts:638 |
|
|
418
|
+
| <a id="cause"></a> `cause?` | `public` | `unknown` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", }).cause` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 |
|
|
419
|
+
| <a id="issues"></a> `issues` | `readonly` | `unknown` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", }).issues` | [packages/core/src/errors.ts:43](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/errors.ts#L43) |
|
|
420
|
+
| <a id="message"></a> `message` | `public` | `string` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", }).message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
|
|
421
|
+
| <a id="name"></a> `name` | `public` | `string` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", }).name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
|
|
422
|
+
| <a id="source"></a> `source` | `readonly` | `string` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", }).source` | [packages/core/src/errors.ts:42](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/errors.ts#L42) |
|
|
423
|
+
| <a id="stack"></a> `stack?` | `public` | `string` | `TaggedError("@amqp-contract/MessageValidationError", { name: "MessageValidationError", }).stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
|
|
610
424
|
|
|
611
425
|
***
|
|
612
426
|
|
|
613
427
|
### TechnicalError
|
|
614
428
|
|
|
615
|
-
Defined in: [packages/core/src/errors.ts:
|
|
429
|
+
Defined in: [packages/core/src/errors.ts:16](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/errors.ts#L16)
|
|
616
430
|
|
|
617
431
|
Error for technical/runtime failures that cannot be prevented by TypeScript.
|
|
618
432
|
|
|
619
433
|
This includes AMQP connection failures, channel issues, validation failures,
|
|
620
434
|
and other runtime errors. This error is shared across core, worker, and client packages.
|
|
621
435
|
|
|
436
|
+
Built on unthrown's [TaggedError](https://github.com/btravstack/unthrown), so it carries a `_tag` of
|
|
437
|
+
`"@amqp-contract/TechnicalError"` for exhaustive dispatch via `matchTags`. The
|
|
438
|
+
tag is namespaced to avoid colliding with other libraries' tags in a shared
|
|
439
|
+
`matchTags`; the human-facing `Error.name` is kept bare (`"TechnicalError"`).
|
|
440
|
+
Remains a real `Error` (and a *modeled* error — it lives in the `E` channel of
|
|
441
|
+
a `Result`, never the `Defect` channel).
|
|
442
|
+
|
|
622
443
|
#### Extends
|
|
623
444
|
|
|
624
|
-
- `
|
|
445
|
+
- `TaggedErrorInstance`<`"@amqp-contract/TechnicalError"`, \{
|
|
446
|
+
`cause?`: `unknown`;
|
|
447
|
+
`message`: `string`;
|
|
448
|
+
\}>
|
|
625
449
|
|
|
626
450
|
#### Constructors
|
|
627
451
|
|
|
@@ -631,7 +455,7 @@ and other runtime errors. This error is shared across core, worker, and client p
|
|
|
631
455
|
new TechnicalError(message, cause?): TechnicalError;
|
|
632
456
|
```
|
|
633
457
|
|
|
634
|
-
Defined in: [packages/core/src/errors.ts:
|
|
458
|
+
Defined in: [packages/core/src/errors.ts:22](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/errors.ts#L22)
|
|
635
459
|
|
|
636
460
|
###### Parameters
|
|
637
461
|
|
|
@@ -647,220 +471,23 @@ Defined in: [packages/core/src/errors.ts:8](https://github.com/btravers/amqp-con
|
|
|
647
471
|
###### Overrides
|
|
648
472
|
|
|
649
473
|
```ts
|
|
650
|
-
|
|
474
|
+
TaggedError("@amqp-contract/TechnicalError", {
|
|
475
|
+
name: "TechnicalError",
|
|
476
|
+
})<{
|
|
477
|
+
message: string;
|
|
478
|
+
cause?: unknown;
|
|
479
|
+
}>.constructor
|
|
651
480
|
```
|
|
652
481
|
|
|
653
482
|
#### Properties
|
|
654
483
|
|
|
655
|
-
| Property | Modifier | Type |
|
|
656
|
-
| ------ | ------ | ------ | ------ | ------ |
|
|
657
|
-
| <a id="
|
|
658
|
-
| <a id="
|
|
659
|
-
| <a id="
|
|
660
|
-
| <a id="
|
|
661
|
-
| <a id="
|
|
662
|
-
|
|
663
|
-
#### Methods
|
|
664
|
-
|
|
665
|
-
##### captureStackTrace()
|
|
666
|
-
|
|
667
|
-
###### Call Signature
|
|
668
|
-
|
|
669
|
-
```ts
|
|
670
|
-
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
671
|
-
```
|
|
672
|
-
|
|
673
|
-
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:51
|
|
674
|
-
|
|
675
|
-
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
676
|
-
a string representing the location in the code at which
|
|
677
|
-
`Error.captureStackTrace()` was called.
|
|
678
|
-
|
|
679
|
-
```js
|
|
680
|
-
const myObject = {};
|
|
681
|
-
Error.captureStackTrace(myObject);
|
|
682
|
-
myObject.stack; // Similar to `new Error().stack`
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
The first line of the trace will be prefixed with
|
|
686
|
-
`${myObject.name}: ${myObject.message}`.
|
|
687
|
-
|
|
688
|
-
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
689
|
-
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
690
|
-
generated stack trace.
|
|
691
|
-
|
|
692
|
-
The `constructorOpt` argument is useful for hiding implementation
|
|
693
|
-
details of error generation from the user. For instance:
|
|
694
|
-
|
|
695
|
-
```js
|
|
696
|
-
function a() {
|
|
697
|
-
b();
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
function b() {
|
|
701
|
-
c();
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
function c() {
|
|
705
|
-
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
706
|
-
const { stackTraceLimit } = Error;
|
|
707
|
-
Error.stackTraceLimit = 0;
|
|
708
|
-
const error = new Error();
|
|
709
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
710
|
-
|
|
711
|
-
// Capture the stack trace above function b
|
|
712
|
-
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
713
|
-
throw error;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
a();
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
###### Parameters
|
|
720
|
-
|
|
721
|
-
| Parameter | Type |
|
|
722
|
-
| ------ | ------ |
|
|
723
|
-
| `targetObject` | `object` |
|
|
724
|
-
| `constructorOpt?` | `Function` |
|
|
725
|
-
|
|
726
|
-
###### Returns
|
|
727
|
-
|
|
728
|
-
`void`
|
|
729
|
-
|
|
730
|
-
###### Inherited from
|
|
731
|
-
|
|
732
|
-
```ts
|
|
733
|
-
Error.captureStackTrace
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
###### Call Signature
|
|
737
|
-
|
|
738
|
-
```ts
|
|
739
|
-
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52
|
|
743
|
-
|
|
744
|
-
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
745
|
-
a string representing the location in the code at which
|
|
746
|
-
`Error.captureStackTrace()` was called.
|
|
747
|
-
|
|
748
|
-
```js
|
|
749
|
-
const myObject = {};
|
|
750
|
-
Error.captureStackTrace(myObject);
|
|
751
|
-
myObject.stack; // Similar to `new Error().stack`
|
|
752
|
-
```
|
|
753
|
-
|
|
754
|
-
The first line of the trace will be prefixed with
|
|
755
|
-
`${myObject.name}: ${myObject.message}`.
|
|
756
|
-
|
|
757
|
-
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
758
|
-
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
759
|
-
generated stack trace.
|
|
760
|
-
|
|
761
|
-
The `constructorOpt` argument is useful for hiding implementation
|
|
762
|
-
details of error generation from the user. For instance:
|
|
763
|
-
|
|
764
|
-
```js
|
|
765
|
-
function a() {
|
|
766
|
-
b();
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
function b() {
|
|
770
|
-
c();
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
function c() {
|
|
774
|
-
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
775
|
-
const { stackTraceLimit } = Error;
|
|
776
|
-
Error.stackTraceLimit = 0;
|
|
777
|
-
const error = new Error();
|
|
778
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
779
|
-
|
|
780
|
-
// Capture the stack trace above function b
|
|
781
|
-
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
782
|
-
throw error;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
a();
|
|
786
|
-
```
|
|
787
|
-
|
|
788
|
-
###### Parameters
|
|
789
|
-
|
|
790
|
-
| Parameter | Type |
|
|
791
|
-
| ------ | ------ |
|
|
792
|
-
| `targetObject` | `object` |
|
|
793
|
-
| `constructorOpt?` | `Function` |
|
|
794
|
-
|
|
795
|
-
###### Returns
|
|
796
|
-
|
|
797
|
-
`void`
|
|
798
|
-
|
|
799
|
-
###### Inherited from
|
|
800
|
-
|
|
801
|
-
```ts
|
|
802
|
-
Error.captureStackTrace
|
|
803
|
-
```
|
|
804
|
-
|
|
805
|
-
##### prepareStackTrace()
|
|
806
|
-
|
|
807
|
-
###### Call Signature
|
|
808
|
-
|
|
809
|
-
```ts
|
|
810
|
-
static prepareStackTrace(err, stackTraces): any;
|
|
811
|
-
```
|
|
812
|
-
|
|
813
|
-
Defined in: node\_modules/.pnpm/@types+node@25.6.0/node\_modules/@types/node/globals.d.ts:55
|
|
814
|
-
|
|
815
|
-
###### Parameters
|
|
816
|
-
|
|
817
|
-
| Parameter | Type |
|
|
818
|
-
| ------ | ------ |
|
|
819
|
-
| `err` | `Error` |
|
|
820
|
-
| `stackTraces` | `CallSite`[] |
|
|
821
|
-
|
|
822
|
-
###### Returns
|
|
823
|
-
|
|
824
|
-
`any`
|
|
825
|
-
|
|
826
|
-
###### See
|
|
827
|
-
|
|
828
|
-
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
829
|
-
|
|
830
|
-
###### Inherited from
|
|
831
|
-
|
|
832
|
-
```ts
|
|
833
|
-
Error.prepareStackTrace
|
|
834
|
-
```
|
|
835
|
-
|
|
836
|
-
###### Call Signature
|
|
837
|
-
|
|
838
|
-
```ts
|
|
839
|
-
static prepareStackTrace(err, stackTraces): any;
|
|
840
|
-
```
|
|
841
|
-
|
|
842
|
-
Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56
|
|
843
|
-
|
|
844
|
-
###### Parameters
|
|
845
|
-
|
|
846
|
-
| Parameter | Type |
|
|
847
|
-
| ------ | ------ |
|
|
848
|
-
| `err` | `Error` |
|
|
849
|
-
| `stackTraces` | `CallSite`[] |
|
|
850
|
-
|
|
851
|
-
###### Returns
|
|
852
|
-
|
|
853
|
-
`any`
|
|
854
|
-
|
|
855
|
-
###### See
|
|
856
|
-
|
|
857
|
-
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
858
|
-
|
|
859
|
-
###### Inherited from
|
|
860
|
-
|
|
861
|
-
```ts
|
|
862
|
-
Error.prepareStackTrace
|
|
863
|
-
```
|
|
484
|
+
| Property | Modifier | Type | Inherited from | Defined in |
|
|
485
|
+
| ------ | ------ | ------ | ------ | ------ |
|
|
486
|
+
| <a id="_tag-1"></a> `_tag` | `readonly` | `"@amqp-contract/TechnicalError"` | `TaggedError("@amqp-contract/TechnicalError", { name: "TechnicalError", })._tag` | node\_modules/.pnpm/unthrown@0.2.0/node\_modules/unthrown/dist/index.d.mts:638 |
|
|
487
|
+
| <a id="cause-1"></a> `cause?` | `public` | `unknown` | [`MessageValidationError`](#messagevalidationerror).[`cause`](#cause) | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 |
|
|
488
|
+
| <a id="message-1"></a> `message` | `public` | `string` | `TaggedError("@amqp-contract/TechnicalError", { name: "TechnicalError", }).message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
|
|
489
|
+
| <a id="name-1"></a> `name` | `public` | `string` | `TaggedError("@amqp-contract/TechnicalError", { name: "TechnicalError", }).name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
|
|
490
|
+
| <a id="stack-1"></a> `stack?` | `public` | `string` | `TaggedError("@amqp-contract/TechnicalError", { name: "TechnicalError", }).stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
|
|
864
491
|
|
|
865
492
|
## Type Aliases
|
|
866
493
|
|
|
@@ -870,7 +497,7 @@ Error.prepareStackTrace
|
|
|
870
497
|
type AmqpClientOptions = object;
|
|
871
498
|
```
|
|
872
499
|
|
|
873
|
-
Defined in: [packages/core/src/amqp-client.ts:73](https://github.com/
|
|
500
|
+
Defined in: [packages/core/src/amqp-client.ts:73](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L73)
|
|
874
501
|
|
|
875
502
|
Options for creating an AMQP client.
|
|
876
503
|
|
|
@@ -878,10 +505,10 @@ Options for creating an AMQP client.
|
|
|
878
505
|
|
|
879
506
|
| Property | Type | Description | Defined in |
|
|
880
507
|
| ------ | ------ | ------ | ------ |
|
|
881
|
-
| <a id="channeloptions"></a> `channelOptions?` | `Partial`<`CreateChannelOpts`> | Optional channel configuration options. | [packages/core/src/amqp-client.ts:76](https://github.com/
|
|
882
|
-
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.). | [packages/core/src/amqp-client.ts:75](https://github.com/
|
|
883
|
-
| <a id="connecttimeoutms"></a> `connectTimeoutMs?` | `number` \| `null` | Maximum time in ms to wait for the channel to become ready in `waitForConnect`. Defaults to [DEFAULT\_CONNECT\_TIMEOUT\_MS](#default_connect_timeout_ms). Pass `null` to disable the timeout entirely (amqp-connection-manager will retry indefinitely). | [packages/core/src/amqp-client.ts:77](https://github.com/
|
|
884
|
-
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | AMQP broker URL(s). Multiple URLs provide failover support. | [packages/core/src/amqp-client.ts:74](https://github.com/
|
|
508
|
+
| <a id="channeloptions"></a> `channelOptions?` | `Partial`<`CreateChannelOpts`> | Optional channel configuration options. | [packages/core/src/amqp-client.ts:76](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L76) |
|
|
509
|
+
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.). | [packages/core/src/amqp-client.ts:75](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L75) |
|
|
510
|
+
| <a id="connecttimeoutms"></a> `connectTimeoutMs?` | `number` \| `null` | Maximum time in ms to wait for the channel to become ready in `waitForConnect`. Defaults to [DEFAULT\_CONNECT\_TIMEOUT\_MS](#default_connect_timeout_ms). Pass `null` to disable the timeout entirely (amqp-connection-manager will retry indefinitely). | [packages/core/src/amqp-client.ts:77](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L77) |
|
|
511
|
+
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | AMQP broker URL(s). Multiple URLs provide failover support. | [packages/core/src/amqp-client.ts:74](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L74) |
|
|
885
512
|
|
|
886
513
|
***
|
|
887
514
|
|
|
@@ -891,7 +518,7 @@ Options for creating an AMQP client.
|
|
|
891
518
|
type ConsumeCallback = (msg) => void | Promise<void>;
|
|
892
519
|
```
|
|
893
520
|
|
|
894
|
-
Defined in: [packages/core/src/amqp-client.ts:83](https://github.com/
|
|
521
|
+
Defined in: [packages/core/src/amqp-client.ts:83](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L83)
|
|
895
522
|
|
|
896
523
|
Callback type for consuming messages.
|
|
897
524
|
|
|
@@ -913,7 +540,7 @@ Callback type for consuming messages.
|
|
|
913
540
|
type ConsumerOptions = Options.Consume & object;
|
|
914
541
|
```
|
|
915
542
|
|
|
916
|
-
Defined in: [packages/core/src/amqp-client.ts:108](https://github.com/
|
|
543
|
+
Defined in: [packages/core/src/amqp-client.ts:108](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L108)
|
|
917
544
|
|
|
918
545
|
Consume options that extend amqplib's `Options.Consume` with an optional
|
|
919
546
|
per-consumer prefetch count.
|
|
@@ -929,7 +556,7 @@ automatically on channel reconnect.
|
|
|
929
556
|
|
|
930
557
|
| Name | Type | Description | Defined in |
|
|
931
558
|
| ------ | ------ | ------ | ------ |
|
|
932
|
-
| `prefetch?` | `number` | Per-consumer prefetch count. Applied before `channel.consume(...)`. | [packages/core/src/amqp-client.ts:110](https://github.com/
|
|
559
|
+
| `prefetch?` | `number` | Per-consumer prefetch count. Applied before `channel.consume(...)`. | [packages/core/src/amqp-client.ts:110](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L110) |
|
|
933
560
|
|
|
934
561
|
***
|
|
935
562
|
|
|
@@ -939,7 +566,7 @@ automatically on channel reconnect.
|
|
|
939
566
|
type Logger = object;
|
|
940
567
|
```
|
|
941
568
|
|
|
942
|
-
Defined in: [packages/core/src/logger.ts:30](https://github.com/
|
|
569
|
+
Defined in: [packages/core/src/logger.ts:30](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L30)
|
|
943
570
|
|
|
944
571
|
Logger interface for amqp-contract packages.
|
|
945
572
|
|
|
@@ -966,7 +593,7 @@ const logger: Logger = {
|
|
|
966
593
|
debug(message, context?): void;
|
|
967
594
|
```
|
|
968
595
|
|
|
969
|
-
Defined in: [packages/core/src/logger.ts:36](https://github.com/
|
|
596
|
+
Defined in: [packages/core/src/logger.ts:36](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L36)
|
|
970
597
|
|
|
971
598
|
Log debug level messages
|
|
972
599
|
|
|
@@ -987,7 +614,7 @@ Log debug level messages
|
|
|
987
614
|
error(message, context?): void;
|
|
988
615
|
```
|
|
989
616
|
|
|
990
|
-
Defined in: [packages/core/src/logger.ts:57](https://github.com/
|
|
617
|
+
Defined in: [packages/core/src/logger.ts:57](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L57)
|
|
991
618
|
|
|
992
619
|
Log error level messages
|
|
993
620
|
|
|
@@ -1008,7 +635,7 @@ Log error level messages
|
|
|
1008
635
|
info(message, context?): void;
|
|
1009
636
|
```
|
|
1010
637
|
|
|
1011
|
-
Defined in: [packages/core/src/logger.ts:43](https://github.com/
|
|
638
|
+
Defined in: [packages/core/src/logger.ts:43](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L43)
|
|
1012
639
|
|
|
1013
640
|
Log info level messages
|
|
1014
641
|
|
|
@@ -1029,7 +656,7 @@ Log info level messages
|
|
|
1029
656
|
warn(message, context?): void;
|
|
1030
657
|
```
|
|
1031
658
|
|
|
1032
|
-
Defined in: [packages/core/src/logger.ts:50](https://github.com/
|
|
659
|
+
Defined in: [packages/core/src/logger.ts:50](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L50)
|
|
1033
660
|
|
|
1034
661
|
Log warning level messages
|
|
1035
662
|
|
|
@@ -1052,7 +679,7 @@ Log warning level messages
|
|
|
1052
679
|
type LoggerContext = Record<string, unknown> & object;
|
|
1053
680
|
```
|
|
1054
681
|
|
|
1055
|
-
Defined in: [packages/core/src/logger.ts:9](https://github.com/
|
|
682
|
+
Defined in: [packages/core/src/logger.ts:9](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L9)
|
|
1056
683
|
|
|
1057
684
|
Context object for logger methods.
|
|
1058
685
|
|
|
@@ -1063,7 +690,7 @@ for common logging context properties.
|
|
|
1063
690
|
|
|
1064
691
|
| Name | Type | Defined in |
|
|
1065
692
|
| ------ | ------ | ------ |
|
|
1066
|
-
| `error?` | `unknown` | [packages/core/src/logger.ts:10](https://github.com/
|
|
693
|
+
| `error?` | `unknown` | [packages/core/src/logger.ts:10](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/logger.ts#L10) |
|
|
1067
694
|
|
|
1068
695
|
***
|
|
1069
696
|
|
|
@@ -1073,7 +700,7 @@ for common logging context properties.
|
|
|
1073
700
|
type PublishOptions = Options.Publish;
|
|
1074
701
|
```
|
|
1075
702
|
|
|
1076
|
-
Defined in: [packages/core/src/amqp-client.ts:95](https://github.com/
|
|
703
|
+
Defined in: [packages/core/src/amqp-client.ts:95](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L95)
|
|
1077
704
|
|
|
1078
705
|
Publish options for `AmqpClient.publish` / `AmqpClient.sendToQueue`.
|
|
1079
706
|
|
|
@@ -1092,7 +719,7 @@ creation, not per-publish.)
|
|
|
1092
719
|
type TelemetryProvider = object;
|
|
1093
720
|
```
|
|
1094
721
|
|
|
1095
|
-
Defined in: [packages/core/src/telemetry.ts:54](https://github.com/
|
|
722
|
+
Defined in: [packages/core/src/telemetry.ts:54](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L54)
|
|
1096
723
|
|
|
1097
724
|
Telemetry provider for AMQP operations.
|
|
1098
725
|
Uses lazy loading to gracefully handle cases where OpenTelemetry is not installed.
|
|
@@ -1101,12 +728,12 @@ Uses lazy loading to gracefully handle cases where OpenTelemetry is not installe
|
|
|
1101
728
|
|
|
1102
729
|
| Property | Type | Description | Defined in |
|
|
1103
730
|
| ------ | ------ | ------ | ------ |
|
|
1104
|
-
| <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:71](https://github.com/
|
|
1105
|
-
| <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:83](https://github.com/
|
|
1106
|
-
| <a id="getlaterpcreplycounter"></a> `getLateRpcReplyCounter` | () => `Counter` \| `undefined` | Get a counter for RPC replies that arrive after the caller has gone away (timeout, cancellation, or unknown correlationId). Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:90](https://github.com/
|
|
1107
|
-
| <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:65](https://github.com/
|
|
1108
|
-
| <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:77](https://github.com/
|
|
1109
|
-
| <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:59](https://github.com/
|
|
731
|
+
| <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:71](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L71) |
|
|
732
|
+
| <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:83](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L83) |
|
|
733
|
+
| <a id="getlaterpcreplycounter"></a> `getLateRpcReplyCounter` | () => `Counter` \| `undefined` | Get a counter for RPC replies that arrive after the caller has gone away (timeout, cancellation, or unknown correlationId). Returns undefined if OpenTelemetry is not available. | [packages/core/src/telemetry.ts:90](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L90) |
|
|
734
|
+
| <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:65](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L65) |
|
|
735
|
+
| <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:77](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L77) |
|
|
736
|
+
| <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:59](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L59) |
|
|
1110
737
|
|
|
1111
738
|
## Variables
|
|
1112
739
|
|
|
@@ -1116,7 +743,7 @@ Uses lazy loading to gracefully handle cases where OpenTelemetry is not installe
|
|
|
1116
743
|
const DEFAULT_CONNECT_TIMEOUT_MS: 30000 = 30_000;
|
|
1117
744
|
```
|
|
1118
745
|
|
|
1119
|
-
Defined in: [packages/core/src/amqp-client.ts:47](https://github.com/
|
|
746
|
+
Defined in: [packages/core/src/amqp-client.ts:47](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/amqp-client.ts#L47)
|
|
1120
747
|
|
|
1121
748
|
Default time `waitForConnect` will wait for the broker before erroring out.
|
|
1122
749
|
Defaulting to a finite value (rather than waiting forever) means a fail-fast
|
|
@@ -1134,7 +761,7 @@ delays to ~24.8 days and silently fires near-immediately on `Infinity`.
|
|
|
1134
761
|
const defaultTelemetryProvider: TelemetryProvider;
|
|
1135
762
|
```
|
|
1136
763
|
|
|
1137
|
-
Defined in: [packages/core/src/telemetry.ts:229](https://github.com/
|
|
764
|
+
Defined in: [packages/core/src/telemetry.ts:229](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L229)
|
|
1138
765
|
|
|
1139
766
|
Default telemetry provider that uses OpenTelemetry API if available.
|
|
1140
767
|
|
|
@@ -1146,7 +773,7 @@ Default telemetry provider that uses OpenTelemetry API if available.
|
|
|
1146
773
|
const MessagingSemanticConventions: object;
|
|
1147
774
|
```
|
|
1148
775
|
|
|
1149
|
-
Defined in: [packages/core/src/telemetry.ts:26](https://github.com/
|
|
776
|
+
Defined in: [packages/core/src/telemetry.ts:26](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L26)
|
|
1150
777
|
|
|
1151
778
|
Semantic conventions for AMQP messaging following OpenTelemetry standards.
|
|
1152
779
|
|
|
@@ -1154,20 +781,20 @@ Semantic conventions for AMQP messaging following OpenTelemetry standards.
|
|
|
1154
781
|
|
|
1155
782
|
| Name | Type | Default value | Defined in |
|
|
1156
783
|
| ------ | ------ | ------ | ------ |
|
|
1157
|
-
| <a id="property-amqp_consumer_name"></a> `AMQP_CONSUMER_NAME` | `"amqp.consumer.name"` | `"amqp.consumer.name"` | [packages/core/src/telemetry.ts:37](https://github.com/
|
|
1158
|
-
| <a id="property-amqp_publisher_name"></a> `AMQP_PUBLISHER_NAME` | `"amqp.publisher.name"` | `"amqp.publisher.name"` | [packages/core/src/telemetry.ts:36](https://github.com/
|
|
1159
|
-
| <a id="property-error_type"></a> `ERROR_TYPE` | `"error.type"` | `"error.type"` | [packages/core/src/telemetry.ts:40](https://github.com/
|
|
1160
|
-
| <a id="property-messaging_destination"></a> `MESSAGING_DESTINATION` | `"messaging.destination.name"` | `"messaging.destination.name"` | [packages/core/src/telemetry.ts:29](https://github.com/
|
|
1161
|
-
| <a id="property-messaging_destination_kind"></a> `MESSAGING_DESTINATION_KIND` | `"messaging.destination.kind"` | `"messaging.destination.kind"` | [packages/core/src/telemetry.ts:30](https://github.com/
|
|
1162
|
-
| <a id="property-messaging_destination_kind_exchange"></a> `MESSAGING_DESTINATION_KIND_EXCHANGE` | `"exchange"` | `"exchange"` | [packages/core/src/telemetry.ts:44](https://github.com/
|
|
1163
|
-
| <a id="property-messaging_destination_kind_queue"></a> `MESSAGING_DESTINATION_KIND_QUEUE` | `"queue"` | `"queue"` | [packages/core/src/telemetry.ts:45](https://github.com/
|
|
1164
|
-
| <a id="property-messaging_operation"></a> `MESSAGING_OPERATION` | `"messaging.operation"` | `"messaging.operation"` | [packages/core/src/telemetry.ts:31](https://github.com/
|
|
1165
|
-
| <a id="property-messaging_operation_process"></a> `MESSAGING_OPERATION_PROCESS` | `"process"` | `"process"` | [packages/core/src/telemetry.ts:47](https://github.com/
|
|
1166
|
-
| <a id="property-messaging_operation_publish"></a> `MESSAGING_OPERATION_PUBLISH` | `"publish"` | `"publish"` | [packages/core/src/telemetry.ts:46](https://github.com/
|
|
1167
|
-
| <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:35](https://github.com/
|
|
1168
|
-
| <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:34](https://github.com/
|
|
1169
|
-
| <a id="property-messaging_system"></a> `MESSAGING_SYSTEM` | `"messaging.system"` | `"messaging.system"` | [packages/core/src/telemetry.ts:28](https://github.com/
|
|
1170
|
-
| <a id="property-messaging_system_rabbitmq"></a> `MESSAGING_SYSTEM_RABBITMQ` | `"rabbitmq"` | `"rabbitmq"` | [packages/core/src/telemetry.ts:43](https://github.com/
|
|
784
|
+
| <a id="property-amqp_consumer_name"></a> `AMQP_CONSUMER_NAME` | `"amqp.consumer.name"` | `"amqp.consumer.name"` | [packages/core/src/telemetry.ts:37](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L37) |
|
|
785
|
+
| <a id="property-amqp_publisher_name"></a> `AMQP_PUBLISHER_NAME` | `"amqp.publisher.name"` | `"amqp.publisher.name"` | [packages/core/src/telemetry.ts:36](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L36) |
|
|
786
|
+
| <a id="property-error_type"></a> `ERROR_TYPE` | `"error.type"` | `"error.type"` | [packages/core/src/telemetry.ts:40](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L40) |
|
|
787
|
+
| <a id="property-messaging_destination"></a> `MESSAGING_DESTINATION` | `"messaging.destination.name"` | `"messaging.destination.name"` | [packages/core/src/telemetry.ts:29](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L29) |
|
|
788
|
+
| <a id="property-messaging_destination_kind"></a> `MESSAGING_DESTINATION_KIND` | `"messaging.destination.kind"` | `"messaging.destination.kind"` | [packages/core/src/telemetry.ts:30](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L30) |
|
|
789
|
+
| <a id="property-messaging_destination_kind_exchange"></a> `MESSAGING_DESTINATION_KIND_EXCHANGE` | `"exchange"` | `"exchange"` | [packages/core/src/telemetry.ts:44](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L44) |
|
|
790
|
+
| <a id="property-messaging_destination_kind_queue"></a> `MESSAGING_DESTINATION_KIND_QUEUE` | `"queue"` | `"queue"` | [packages/core/src/telemetry.ts:45](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L45) |
|
|
791
|
+
| <a id="property-messaging_operation"></a> `MESSAGING_OPERATION` | `"messaging.operation"` | `"messaging.operation"` | [packages/core/src/telemetry.ts:31](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L31) |
|
|
792
|
+
| <a id="property-messaging_operation_process"></a> `MESSAGING_OPERATION_PROCESS` | `"process"` | `"process"` | [packages/core/src/telemetry.ts:47](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L47) |
|
|
793
|
+
| <a id="property-messaging_operation_publish"></a> `MESSAGING_OPERATION_PUBLISH` | `"publish"` | `"publish"` | [packages/core/src/telemetry.ts:46](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L46) |
|
|
794
|
+
| <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:35](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L35) |
|
|
795
|
+
| <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:34](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L34) |
|
|
796
|
+
| <a id="property-messaging_system"></a> `MESSAGING_SYSTEM` | `"messaging.system"` | `"messaging.system"` | [packages/core/src/telemetry.ts:28](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L28) |
|
|
797
|
+
| <a id="property-messaging_system_rabbitmq"></a> `MESSAGING_SYSTEM_RABBITMQ` | `"rabbitmq"` | `"rabbitmq"` | [packages/core/src/telemetry.ts:43](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L43) |
|
|
1171
798
|
|
|
1172
799
|
#### See
|
|
1173
800
|
|
|
@@ -1181,7 +808,7 @@ https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/
|
|
|
1181
808
|
function endSpanError(span, error): void;
|
|
1182
809
|
```
|
|
1183
810
|
|
|
1184
|
-
Defined in: [packages/core/src/telemetry.ts:324](https://github.com/
|
|
811
|
+
Defined in: [packages/core/src/telemetry.ts:324](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L324)
|
|
1185
812
|
|
|
1186
813
|
End a span with error status.
|
|
1187
814
|
|
|
@@ -1204,7 +831,7 @@ End a span with error status.
|
|
|
1204
831
|
function endSpanSuccess(span): void;
|
|
1205
832
|
```
|
|
1206
833
|
|
|
1207
|
-
Defined in: [packages/core/src/telemetry.ts:309](https://github.com/
|
|
834
|
+
Defined in: [packages/core/src/telemetry.ts:309](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L309)
|
|
1208
835
|
|
|
1209
836
|
End a span with success status.
|
|
1210
837
|
|
|
@@ -1231,7 +858,7 @@ function recordConsumeMetric(
|
|
|
1231
858
|
durationMs): void;
|
|
1232
859
|
```
|
|
1233
860
|
|
|
1234
|
-
Defined in: [packages/core/src/telemetry.ts:368](https://github.com/
|
|
861
|
+
Defined in: [packages/core/src/telemetry.ts:368](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L368)
|
|
1235
862
|
|
|
1236
863
|
Record a consume metric.
|
|
1237
864
|
|
|
@@ -1257,7 +884,7 @@ Record a consume metric.
|
|
|
1257
884
|
function recordLateRpcReply(provider, reason): void;
|
|
1258
885
|
```
|
|
1259
886
|
|
|
1260
|
-
Defined in: [packages/core/src/telemetry.ts:398](https://github.com/
|
|
887
|
+
Defined in: [packages/core/src/telemetry.ts:398](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L398)
|
|
1261
888
|
|
|
1262
889
|
Record an RPC reply that arrived after the caller stopped waiting.
|
|
1263
890
|
|
|
@@ -1285,7 +912,7 @@ function recordPublishMetric(
|
|
|
1285
912
|
durationMs): void;
|
|
1286
913
|
```
|
|
1287
914
|
|
|
1288
|
-
Defined in: [packages/core/src/telemetry.ts:341](https://github.com/
|
|
915
|
+
Defined in: [packages/core/src/telemetry.ts:341](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L341)
|
|
1289
916
|
|
|
1290
917
|
Record a publish metric.
|
|
1291
918
|
|
|
@@ -1311,7 +938,7 @@ Record a publish metric.
|
|
|
1311
938
|
function safeJsonParse<E>(buffer, errorFn): Result<unknown, E>;
|
|
1312
939
|
```
|
|
1313
940
|
|
|
1314
|
-
Defined in: [packages/core/src/parsing.ts:24](https://github.com/
|
|
941
|
+
Defined in: [packages/core/src/parsing.ts:24](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/parsing.ts#L24)
|
|
1315
942
|
|
|
1316
943
|
Parse a `Buffer` as JSON, mapping any `JSON.parse` exception to the
|
|
1317
944
|
caller-supplied error type.
|
|
@@ -1356,7 +983,7 @@ const parsed = safeJsonParse(
|
|
|
1356
983
|
function setupAmqpTopology(channel, contract): Promise<void>;
|
|
1357
984
|
```
|
|
1358
985
|
|
|
1359
|
-
Defined in: [packages/core/src/setup.ts:26](https://github.com/
|
|
986
|
+
Defined in: [packages/core/src/setup.ts:26](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/setup.ts#L26)
|
|
1360
987
|
|
|
1361
988
|
Setup AMQP topology (exchanges, queues, and bindings) from a contract definition.
|
|
1362
989
|
|
|
@@ -1404,7 +1031,7 @@ function startConsumeSpan(
|
|
|
1404
1031
|
attributes?): Span | undefined;
|
|
1405
1032
|
```
|
|
1406
1033
|
|
|
1407
|
-
Defined in: [packages/core/src/telemetry.ts:277](https://github.com/
|
|
1034
|
+
Defined in: [packages/core/src/telemetry.ts:277](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L277)
|
|
1408
1035
|
|
|
1409
1036
|
Create a span for a consume/process operation.
|
|
1410
1037
|
Returns undefined if OpenTelemetry is not available.
|
|
@@ -1434,7 +1061,7 @@ function startPublishSpan(
|
|
|
1434
1061
|
attributes?): Span | undefined;
|
|
1435
1062
|
```
|
|
1436
1063
|
|
|
1437
|
-
Defined in: [packages/core/src/telemetry.ts:242](https://github.com/
|
|
1064
|
+
Defined in: [packages/core/src/telemetry.ts:242](https://github.com/btravstack/amqp-contract/blob/5bdec81d9ab13131c5b7f699c426616cfbed2b5f/packages/core/src/telemetry.ts#L242)
|
|
1438
1065
|
|
|
1439
1066
|
Create a span for a publish operation.
|
|
1440
1067
|
Returns undefined if OpenTelemetry is not available.
|