@amqp-contract/core 0.23.1 → 0.24.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 +8 -6
- package/dist/index.cjs +26 -37
- package/dist/index.d.cts +19 -34
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +19 -34
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +26 -37
- package/dist/index.mjs.map +1 -1
- package/docs/index.md +113 -117
- package/package.json +5 -5
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:129](https://github.com/btravers/amqp-contract/blob/
|
|
11
|
+
Defined in: [packages/core/src/amqp-client.ts:129](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L129)
|
|
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 `ResultAsync<T, TechnicalError>` for consistent error handling.
|
|
22
22
|
|
|
23
23
|
#### Example
|
|
24
24
|
|
|
@@ -28,14 +28,14 @@ const client = new AmqpClient(contract, {
|
|
|
28
28
|
connectionOptions: { heartbeatIntervalInSeconds: 30 }
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
// Wait for connection
|
|
32
|
-
await client.waitForConnect()
|
|
31
|
+
// Wait for connection (ResultAsync is thenable)
|
|
32
|
+
await client.waitForConnect();
|
|
33
33
|
|
|
34
34
|
// Publish a message
|
|
35
|
-
const result = await client.publish('exchange', 'routingKey', { data: 'value' })
|
|
35
|
+
const result = await client.publish('exchange', 'routingKey', { data: 'value' });
|
|
36
36
|
|
|
37
37
|
// Close when done
|
|
38
|
-
await client.close()
|
|
38
|
+
await client.close();
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
#### Constructors
|
|
@@ -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:148](https://github.com/btravers/amqp-contract/blob/
|
|
49
|
+
Defined in: [packages/core/src/amqp-client.ts:148](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L148)
|
|
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:315](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L315)
|
|
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:337](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L337)
|
|
99
99
|
|
|
100
100
|
Add a setup function to be called when the channel is created or reconnected.
|
|
101
101
|
|
|
@@ -114,32 +114,30 @@ 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): ResultAsync<void, TechnicalError>;
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
120
|
+
Defined in: [packages/core/src/amqp-client.ts:302](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L302)
|
|
121
121
|
|
|
122
122
|
Cancel a consumer by its consumer tag.
|
|
123
123
|
|
|
124
124
|
###### Parameters
|
|
125
125
|
|
|
126
|
-
| Parameter | Type |
|
|
127
|
-
| ------ | ------ |
|
|
128
|
-
| `consumerTag` | `string` |
|
|
126
|
+
| Parameter | Type |
|
|
127
|
+
| ------ | ------ |
|
|
128
|
+
| `consumerTag` | `string` |
|
|
129
129
|
|
|
130
130
|
###### Returns
|
|
131
131
|
|
|
132
|
-
`
|
|
133
|
-
|
|
134
|
-
A Future that resolves when the consumer is cancelled
|
|
132
|
+
`ResultAsync`<`void`, [`TechnicalError`](#technicalerror)>
|
|
135
133
|
|
|
136
134
|
##### close()
|
|
137
135
|
|
|
138
136
|
```ts
|
|
139
|
-
close():
|
|
137
|
+
close(): ResultAsync<void, TechnicalError>;
|
|
140
138
|
```
|
|
141
139
|
|
|
142
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
140
|
+
Defined in: [packages/core/src/amqp-client.ts:367](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L367)
|
|
143
141
|
|
|
144
142
|
Close the channel and release the connection reference.
|
|
145
143
|
|
|
@@ -148,11 +146,12 @@ This will:
|
|
|
148
146
|
- Decrease the reference count on the shared connection
|
|
149
147
|
- Close the connection if this was the last client using it
|
|
150
148
|
|
|
151
|
-
|
|
149
|
+
Both steps run regardless of each other's outcome; if both fail, the
|
|
150
|
+
errors are wrapped in an AggregateError.
|
|
152
151
|
|
|
153
|
-
|
|
152
|
+
###### Returns
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
`ResultAsync`<`void`, [`TechnicalError`](#technicalerror)>
|
|
156
155
|
|
|
157
156
|
##### consume()
|
|
158
157
|
|
|
@@ -160,26 +159,26 @@ A Future that resolves when the channel and connection are closed
|
|
|
160
159
|
consume(
|
|
161
160
|
queue,
|
|
162
161
|
callback,
|
|
163
|
-
options?):
|
|
162
|
+
options?): ResultAsync<string, TechnicalError>;
|
|
164
163
|
```
|
|
165
164
|
|
|
166
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
165
|
+
Defined in: [packages/core/src/amqp-client.ts:288](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L288)
|
|
167
166
|
|
|
168
167
|
Start consuming messages from a queue.
|
|
169
168
|
|
|
170
169
|
###### Parameters
|
|
171
170
|
|
|
172
|
-
| Parameter | Type |
|
|
173
|
-
| ------ | ------ |
|
|
174
|
-
| `queue` | `string` |
|
|
175
|
-
| `callback` | [`ConsumeCallback`](#consumecallback) |
|
|
176
|
-
| `options?` | [`ConsumerOptions`](#consumeroptions) |
|
|
171
|
+
| Parameter | Type |
|
|
172
|
+
| ------ | ------ |
|
|
173
|
+
| `queue` | `string` |
|
|
174
|
+
| `callback` | [`ConsumeCallback`](#consumecallback) |
|
|
175
|
+
| `options?` | [`ConsumerOptions`](#consumeroptions) |
|
|
177
176
|
|
|
178
177
|
###### Returns
|
|
179
178
|
|
|
180
|
-
`
|
|
179
|
+
`ResultAsync`<`string`, [`TechnicalError`](#technicalerror)>
|
|
181
180
|
|
|
182
|
-
|
|
181
|
+
ResultAsync resolving to the consumer tag.
|
|
183
182
|
|
|
184
183
|
##### getConnection()
|
|
185
184
|
|
|
@@ -187,7 +186,7 @@ A Future with `Result<string>` - the consumer tag
|
|
|
187
186
|
getConnection(): IAmqpConnectionManager;
|
|
188
187
|
```
|
|
189
188
|
|
|
190
|
-
Defined in: [packages/core/src/amqp-client.ts:203](https://github.com/btravers/amqp-contract/blob/
|
|
189
|
+
Defined in: [packages/core/src/amqp-client.ts:203](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L203)
|
|
191
190
|
|
|
192
191
|
Get the underlying connection manager
|
|
193
192
|
|
|
@@ -210,7 +209,7 @@ nack(
|
|
|
210
209
|
requeue?): void;
|
|
211
210
|
```
|
|
212
211
|
|
|
213
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
212
|
+
Defined in: [packages/core/src/amqp-client.ts:326](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L326)
|
|
214
213
|
|
|
215
214
|
Negative acknowledge a message.
|
|
216
215
|
|
|
@@ -232,7 +231,7 @@ Negative acknowledge a message.
|
|
|
232
231
|
on(event, listener): void;
|
|
233
232
|
```
|
|
234
233
|
|
|
235
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
234
|
+
Defined in: [packages/core/src/amqp-client.ts:352](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L352)
|
|
236
235
|
|
|
237
236
|
Register an event listener on the channel wrapper.
|
|
238
237
|
|
|
@@ -259,27 +258,27 @@ publish(
|
|
|
259
258
|
exchange,
|
|
260
259
|
routingKey,
|
|
261
260
|
content,
|
|
262
|
-
options?):
|
|
261
|
+
options?): ResultAsync<boolean, TechnicalError>;
|
|
263
262
|
```
|
|
264
263
|
|
|
265
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
264
|
+
Defined in: [packages/core/src/amqp-client.ts:255](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L255)
|
|
266
265
|
|
|
267
266
|
Publish a message to an exchange.
|
|
268
267
|
|
|
269
268
|
###### Parameters
|
|
270
269
|
|
|
271
|
-
| Parameter | Type |
|
|
272
|
-
| ------ | ------ |
|
|
273
|
-
| `exchange` | `string` |
|
|
274
|
-
| `routingKey` | `string` |
|
|
275
|
-
| `content` | `unknown` |
|
|
276
|
-
| `options?` | [`PublishOptions`](#publishoptions) |
|
|
270
|
+
| Parameter | Type |
|
|
271
|
+
| ------ | ------ |
|
|
272
|
+
| `exchange` | `string` |
|
|
273
|
+
| `routingKey` | `string` |
|
|
274
|
+
| `content` | `unknown` |
|
|
275
|
+
| `options?` | [`PublishOptions`](#publishoptions) |
|
|
277
276
|
|
|
278
277
|
###### Returns
|
|
279
278
|
|
|
280
|
-
`
|
|
279
|
+
`ResultAsync`<`boolean`, [`TechnicalError`](#technicalerror)>
|
|
281
280
|
|
|
282
|
-
|
|
281
|
+
ResultAsync resolving to `true` if the message was sent, `false` if the channel buffer is full.
|
|
283
282
|
|
|
284
283
|
##### sendToQueue()
|
|
285
284
|
|
|
@@ -287,39 +286,39 @@ A Future with `Result<boolean>` - true if message was sent, false if channel buf
|
|
|
287
286
|
sendToQueue(
|
|
288
287
|
queue,
|
|
289
288
|
content,
|
|
290
|
-
options?):
|
|
289
|
+
options?): ResultAsync<boolean, TechnicalError>;
|
|
291
290
|
```
|
|
292
291
|
|
|
293
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
292
|
+
Defined in: [packages/core/src/amqp-client.ts:272](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L272)
|
|
294
293
|
|
|
295
294
|
Publish a message directly to a queue.
|
|
296
295
|
|
|
297
296
|
###### Parameters
|
|
298
297
|
|
|
299
|
-
| Parameter | Type |
|
|
300
|
-
| ------ | ------ |
|
|
301
|
-
| `queue` | `string` |
|
|
302
|
-
| `content` | `unknown` |
|
|
303
|
-
| `options?` | [`PublishOptions`](#publishoptions) |
|
|
298
|
+
| Parameter | Type |
|
|
299
|
+
| ------ | ------ |
|
|
300
|
+
| `queue` | `string` |
|
|
301
|
+
| `content` | `unknown` |
|
|
302
|
+
| `options?` | [`PublishOptions`](#publishoptions) |
|
|
304
303
|
|
|
305
304
|
###### Returns
|
|
306
305
|
|
|
307
|
-
`
|
|
306
|
+
`ResultAsync`<`boolean`, [`TechnicalError`](#technicalerror)>
|
|
308
307
|
|
|
309
|
-
|
|
308
|
+
ResultAsync resolving to `true` if the message was sent, `false` if the channel buffer is full.
|
|
310
309
|
|
|
311
310
|
##### waitForConnect()
|
|
312
311
|
|
|
313
312
|
```ts
|
|
314
|
-
waitForConnect():
|
|
313
|
+
waitForConnect(): ResultAsync<void, TechnicalError>;
|
|
315
314
|
```
|
|
316
315
|
|
|
317
|
-
Defined in: [packages/core/src/amqp-client.ts:
|
|
316
|
+
Defined in: [packages/core/src/amqp-client.ts:221](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L221)
|
|
318
317
|
|
|
319
318
|
Wait for the channel to be connected and ready.
|
|
320
319
|
|
|
321
320
|
If `connectTimeoutMs` was provided in the constructor options, the returned
|
|
322
|
-
|
|
321
|
+
ResultAsync resolves to `err(TechnicalError)` once the timeout elapses.
|
|
323
322
|
Without a timeout, this waits forever — amqp-connection-manager retries
|
|
324
323
|
connections indefinitely and never errors on its own.
|
|
325
324
|
|
|
@@ -331,16 +330,13 @@ automatically. The typed factories handle this cleanup for you.
|
|
|
331
330
|
|
|
332
331
|
###### Returns
|
|
333
332
|
|
|
334
|
-
`
|
|
335
|
-
|
|
336
|
-
A Future resolving to `Result.Ok(void)` on connect, or
|
|
337
|
-
`Result.Error(TechnicalError)` on timeout / connection failure.
|
|
333
|
+
`ResultAsync`<`void`, [`TechnicalError`](#technicalerror)>
|
|
338
334
|
|
|
339
335
|
***
|
|
340
336
|
|
|
341
337
|
### MessageValidationError
|
|
342
338
|
|
|
343
|
-
Defined in: [packages/core/src/errors.ts:33](https://github.com/btravers/amqp-contract/blob/
|
|
339
|
+
Defined in: [packages/core/src/errors.ts:33](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L33)
|
|
344
340
|
|
|
345
341
|
Error thrown when message validation fails (payload or headers).
|
|
346
342
|
|
|
@@ -367,7 +363,7 @@ The validation issues from the Standard Schema validation
|
|
|
367
363
|
new MessageValidationError(source, issues): MessageValidationError;
|
|
368
364
|
```
|
|
369
365
|
|
|
370
|
-
Defined in: [packages/core/src/errors.ts:34](https://github.com/btravers/amqp-contract/blob/
|
|
366
|
+
Defined in: [packages/core/src/errors.ts:34](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L34)
|
|
371
367
|
|
|
372
368
|
###### Parameters
|
|
373
369
|
|
|
@@ -391,10 +387,10 @@ Error.constructor
|
|
|
391
387
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
392
388
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
393
389
|
| <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 |
|
|
394
|
-
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/core/src/errors.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
390
|
+
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/core/src/errors.ts:36](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L36) |
|
|
395
391
|
| <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 |
|
|
396
392
|
| <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 |
|
|
397
|
-
| <a id="source"></a> `source` | `readonly` | `string` | - | - | [packages/core/src/errors.ts:35](https://github.com/btravers/amqp-contract/blob/
|
|
393
|
+
| <a id="source"></a> `source` | `readonly` | `string` | - | - | [packages/core/src/errors.ts:35](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L35) |
|
|
398
394
|
| <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 |
|
|
399
395
|
| <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 |
|
|
400
396
|
|
|
@@ -604,7 +600,7 @@ Error.prepareStackTrace
|
|
|
604
600
|
|
|
605
601
|
### TechnicalError
|
|
606
602
|
|
|
607
|
-
Defined in: [packages/core/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/
|
|
603
|
+
Defined in: [packages/core/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L7)
|
|
608
604
|
|
|
609
605
|
Error for technical/runtime failures that cannot be prevented by TypeScript.
|
|
610
606
|
|
|
@@ -623,7 +619,7 @@ and other runtime errors. This error is shared across core, worker, and client p
|
|
|
623
619
|
new TechnicalError(message, cause?): TechnicalError;
|
|
624
620
|
```
|
|
625
621
|
|
|
626
|
-
Defined in: [packages/core/src/errors.ts:8](https://github.com/btravers/amqp-contract/blob/
|
|
622
|
+
Defined in: [packages/core/src/errors.ts:8](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L8)
|
|
627
623
|
|
|
628
624
|
###### Parameters
|
|
629
625
|
|
|
@@ -646,7 +642,7 @@ Error.constructor
|
|
|
646
642
|
|
|
647
643
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
648
644
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
649
|
-
| <a id="cause-1"></a> `cause?` | `readonly` | `unknown` | - | `Error.cause` | [packages/core/src/errors.ts:10](https://github.com/btravers/amqp-contract/blob/
|
|
645
|
+
| <a id="cause-1"></a> `cause?` | `readonly` | `unknown` | - | `Error.cause` | [packages/core/src/errors.ts:10](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/errors.ts#L10) |
|
|
650
646
|
| <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 |
|
|
651
647
|
| <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 |
|
|
652
648
|
| <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 |
|
|
@@ -862,7 +858,7 @@ Error.prepareStackTrace
|
|
|
862
858
|
type AmqpClientOptions = object;
|
|
863
859
|
```
|
|
864
860
|
|
|
865
|
-
Defined in: [packages/core/src/amqp-client.ts:73](https://github.com/btravers/amqp-contract/blob/
|
|
861
|
+
Defined in: [packages/core/src/amqp-client.ts:73](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L73)
|
|
866
862
|
|
|
867
863
|
Options for creating an AMQP client.
|
|
868
864
|
|
|
@@ -870,10 +866,10 @@ Options for creating an AMQP client.
|
|
|
870
866
|
|
|
871
867
|
| Property | Type | Description | Defined in |
|
|
872
868
|
| ------ | ------ | ------ | ------ |
|
|
873
|
-
| <a id="channeloptions"></a> `channelOptions?` | `Partial`<`CreateChannelOpts`> | Optional channel configuration options. | [packages/core/src/amqp-client.ts:76](https://github.com/btravers/amqp-contract/blob/
|
|
874
|
-
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.). | [packages/core/src/amqp-client.ts:75](https://github.com/btravers/amqp-contract/blob/
|
|
875
|
-
| <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/btravers/amqp-contract/blob/
|
|
876
|
-
| <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/btravers/amqp-contract/blob/
|
|
869
|
+
| <a id="channeloptions"></a> `channelOptions?` | `Partial`<`CreateChannelOpts`> | Optional channel configuration options. | [packages/core/src/amqp-client.ts:76](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L76) |
|
|
870
|
+
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.). | [packages/core/src/amqp-client.ts:75](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L75) |
|
|
871
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L77) |
|
|
872
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L74) |
|
|
877
873
|
|
|
878
874
|
***
|
|
879
875
|
|
|
@@ -883,7 +879,7 @@ Options for creating an AMQP client.
|
|
|
883
879
|
type ConsumeCallback = (msg) => void | Promise<void>;
|
|
884
880
|
```
|
|
885
881
|
|
|
886
|
-
Defined in: [packages/core/src/amqp-client.ts:83](https://github.com/btravers/amqp-contract/blob/
|
|
882
|
+
Defined in: [packages/core/src/amqp-client.ts:83](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L83)
|
|
887
883
|
|
|
888
884
|
Callback type for consuming messages.
|
|
889
885
|
|
|
@@ -905,7 +901,7 @@ Callback type for consuming messages.
|
|
|
905
901
|
type ConsumerOptions = Options.Consume & object;
|
|
906
902
|
```
|
|
907
903
|
|
|
908
|
-
Defined in: [packages/core/src/amqp-client.ts:96](https://github.com/btravers/amqp-contract/blob/
|
|
904
|
+
Defined in: [packages/core/src/amqp-client.ts:96](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L96)
|
|
909
905
|
|
|
910
906
|
Consume options that extend amqplib's Options.Consume with optional prefetch support.
|
|
911
907
|
|
|
@@ -913,7 +909,7 @@ Consume options that extend amqplib's Options.Consume with optional prefetch sup
|
|
|
913
909
|
|
|
914
910
|
| Name | Type | Description | Defined in |
|
|
915
911
|
| ------ | ------ | ------ | ------ |
|
|
916
|
-
| `prefetch?` | `number` | Number of messages to prefetch | [packages/core/src/amqp-client.ts:98](https://github.com/btravers/amqp-contract/blob/
|
|
912
|
+
| `prefetch?` | `number` | Number of messages to prefetch | [packages/core/src/amqp-client.ts:98](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L98) |
|
|
917
913
|
|
|
918
914
|
***
|
|
919
915
|
|
|
@@ -923,7 +919,7 @@ Consume options that extend amqplib's Options.Consume with optional prefetch sup
|
|
|
923
919
|
type Logger = object;
|
|
924
920
|
```
|
|
925
921
|
|
|
926
|
-
Defined in: [packages/core/src/logger.ts:30](https://github.com/btravers/amqp-contract/blob/
|
|
922
|
+
Defined in: [packages/core/src/logger.ts:30](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L30)
|
|
927
923
|
|
|
928
924
|
Logger interface for amqp-contract packages.
|
|
929
925
|
|
|
@@ -950,7 +946,7 @@ const logger: Logger = {
|
|
|
950
946
|
debug(message, context?): void;
|
|
951
947
|
```
|
|
952
948
|
|
|
953
|
-
Defined in: [packages/core/src/logger.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
949
|
+
Defined in: [packages/core/src/logger.ts:36](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L36)
|
|
954
950
|
|
|
955
951
|
Log debug level messages
|
|
956
952
|
|
|
@@ -971,7 +967,7 @@ Log debug level messages
|
|
|
971
967
|
error(message, context?): void;
|
|
972
968
|
```
|
|
973
969
|
|
|
974
|
-
Defined in: [packages/core/src/logger.ts:57](https://github.com/btravers/amqp-contract/blob/
|
|
970
|
+
Defined in: [packages/core/src/logger.ts:57](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L57)
|
|
975
971
|
|
|
976
972
|
Log error level messages
|
|
977
973
|
|
|
@@ -992,7 +988,7 @@ Log error level messages
|
|
|
992
988
|
info(message, context?): void;
|
|
993
989
|
```
|
|
994
990
|
|
|
995
|
-
Defined in: [packages/core/src/logger.ts:43](https://github.com/btravers/amqp-contract/blob/
|
|
991
|
+
Defined in: [packages/core/src/logger.ts:43](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L43)
|
|
996
992
|
|
|
997
993
|
Log info level messages
|
|
998
994
|
|
|
@@ -1013,7 +1009,7 @@ Log info level messages
|
|
|
1013
1009
|
warn(message, context?): void;
|
|
1014
1010
|
```
|
|
1015
1011
|
|
|
1016
|
-
Defined in: [packages/core/src/logger.ts:50](https://github.com/btravers/amqp-contract/blob/
|
|
1012
|
+
Defined in: [packages/core/src/logger.ts:50](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L50)
|
|
1017
1013
|
|
|
1018
1014
|
Log warning level messages
|
|
1019
1015
|
|
|
@@ -1036,7 +1032,7 @@ Log warning level messages
|
|
|
1036
1032
|
type LoggerContext = Record<string, unknown> & object;
|
|
1037
1033
|
```
|
|
1038
1034
|
|
|
1039
|
-
Defined in: [packages/core/src/logger.ts:9](https://github.com/btravers/amqp-contract/blob/
|
|
1035
|
+
Defined in: [packages/core/src/logger.ts:9](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L9)
|
|
1040
1036
|
|
|
1041
1037
|
Context object for logger methods.
|
|
1042
1038
|
|
|
@@ -1047,7 +1043,7 @@ for common logging context properties.
|
|
|
1047
1043
|
|
|
1048
1044
|
| Name | Type | Defined in |
|
|
1049
1045
|
| ------ | ------ | ------ |
|
|
1050
|
-
| `error?` | `unknown` | [packages/core/src/logger.ts:10](https://github.com/btravers/amqp-contract/blob/
|
|
1046
|
+
| `error?` | `unknown` | [packages/core/src/logger.ts:10](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/logger.ts#L10) |
|
|
1051
1047
|
|
|
1052
1048
|
***
|
|
1053
1049
|
|
|
@@ -1057,7 +1053,7 @@ for common logging context properties.
|
|
|
1057
1053
|
type PublishOptions = Options.Publish & object;
|
|
1058
1054
|
```
|
|
1059
1055
|
|
|
1060
|
-
Defined in: [packages/core/src/amqp-client.ts:88](https://github.com/btravers/amqp-contract/blob/
|
|
1056
|
+
Defined in: [packages/core/src/amqp-client.ts:88](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L88)
|
|
1061
1057
|
|
|
1062
1058
|
Publish options that extend amqplib's Options.Publish with optional timeout support.
|
|
1063
1059
|
|
|
@@ -1065,7 +1061,7 @@ Publish options that extend amqplib's Options.Publish with optional timeout supp
|
|
|
1065
1061
|
|
|
1066
1062
|
| Name | Type | Description | Defined in |
|
|
1067
1063
|
| ------ | ------ | ------ | ------ |
|
|
1068
|
-
| `timeout?` | `number` | Message will be rejected after timeout ms | [packages/core/src/amqp-client.ts:90](https://github.com/btravers/amqp-contract/blob/
|
|
1064
|
+
| `timeout?` | `number` | Message will be rejected after timeout ms | [packages/core/src/amqp-client.ts:90](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L90) |
|
|
1069
1065
|
|
|
1070
1066
|
***
|
|
1071
1067
|
|
|
@@ -1075,7 +1071,7 @@ Publish options that extend amqplib's Options.Publish with optional timeout supp
|
|
|
1075
1071
|
type TelemetryProvider = object;
|
|
1076
1072
|
```
|
|
1077
1073
|
|
|
1078
|
-
Defined in: [packages/core/src/telemetry.ts:54](https://github.com/btravers/amqp-contract/blob/
|
|
1074
|
+
Defined in: [packages/core/src/telemetry.ts:54](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L54)
|
|
1079
1075
|
|
|
1080
1076
|
Telemetry provider for AMQP operations.
|
|
1081
1077
|
Uses lazy loading to gracefully handle cases where OpenTelemetry is not installed.
|
|
@@ -1084,12 +1080,12 @@ Uses lazy loading to gracefully handle cases where OpenTelemetry is not installe
|
|
|
1084
1080
|
|
|
1085
1081
|
| Property | Type | Description | Defined in |
|
|
1086
1082
|
| ------ | ------ | ------ | ------ |
|
|
1087
|
-
| <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/btravers/amqp-contract/blob/
|
|
1088
|
-
| <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/btravers/amqp-contract/blob/
|
|
1089
|
-
| <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/btravers/amqp-contract/blob/
|
|
1090
|
-
| <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/btravers/amqp-contract/blob/
|
|
1091
|
-
| <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/btravers/amqp-contract/blob/
|
|
1092
|
-
| <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/btravers/amqp-contract/blob/
|
|
1083
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L71) |
|
|
1084
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L83) |
|
|
1085
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L90) |
|
|
1086
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L65) |
|
|
1087
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L77) |
|
|
1088
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L59) |
|
|
1093
1089
|
|
|
1094
1090
|
## Variables
|
|
1095
1091
|
|
|
@@ -1099,12 +1095,12 @@ Uses lazy loading to gracefully handle cases where OpenTelemetry is not installe
|
|
|
1099
1095
|
const DEFAULT_CONNECT_TIMEOUT_MS: 30000 = 30_000;
|
|
1100
1096
|
```
|
|
1101
1097
|
|
|
1102
|
-
Defined in: [packages/core/src/amqp-client.ts:47](https://github.com/btravers/amqp-contract/blob/
|
|
1098
|
+
Defined in: [packages/core/src/amqp-client.ts:47](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/amqp-client.ts#L47)
|
|
1103
1099
|
|
|
1104
1100
|
Default time `waitForConnect` will wait for the broker before erroring out.
|
|
1105
1101
|
Defaulting to a finite value (rather than waiting forever) means a fail-fast
|
|
1106
1102
|
developer experience: a misconfigured URL, a down broker, or wrong
|
|
1107
|
-
credentials surface as
|
|
1103
|
+
credentials surface as an `err` within 30 seconds. Pass `null`
|
|
1108
1104
|
explicitly to disable the timeout — `Infinity` and other non-finite values
|
|
1109
1105
|
are also coerced to "no timeout" because Node's `setTimeout` clamps large
|
|
1110
1106
|
delays to ~24.8 days and silently fires near-immediately on `Infinity`.
|
|
@@ -1117,7 +1113,7 @@ delays to ~24.8 days and silently fires near-immediately on `Infinity`.
|
|
|
1117
1113
|
const defaultTelemetryProvider: TelemetryProvider;
|
|
1118
1114
|
```
|
|
1119
1115
|
|
|
1120
|
-
Defined in: [packages/core/src/telemetry.ts:229](https://github.com/btravers/amqp-contract/blob/
|
|
1116
|
+
Defined in: [packages/core/src/telemetry.ts:229](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L229)
|
|
1121
1117
|
|
|
1122
1118
|
Default telemetry provider that uses OpenTelemetry API if available.
|
|
1123
1119
|
|
|
@@ -1129,7 +1125,7 @@ Default telemetry provider that uses OpenTelemetry API if available.
|
|
|
1129
1125
|
const MessagingSemanticConventions: object;
|
|
1130
1126
|
```
|
|
1131
1127
|
|
|
1132
|
-
Defined in: [packages/core/src/telemetry.ts:26](https://github.com/btravers/amqp-contract/blob/
|
|
1128
|
+
Defined in: [packages/core/src/telemetry.ts:26](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L26)
|
|
1133
1129
|
|
|
1134
1130
|
Semantic conventions for AMQP messaging following OpenTelemetry standards.
|
|
1135
1131
|
|
|
@@ -1137,20 +1133,20 @@ Semantic conventions for AMQP messaging following OpenTelemetry standards.
|
|
|
1137
1133
|
|
|
1138
1134
|
| Name | Type | Default value | Defined in |
|
|
1139
1135
|
| ------ | ------ | ------ | ------ |
|
|
1140
|
-
| <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/btravers/amqp-contract/blob/
|
|
1141
|
-
| <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/btravers/amqp-contract/blob/
|
|
1142
|
-
| <a id="property-error_type"></a> `ERROR_TYPE` | `"error.type"` | `"error.type"` | [packages/core/src/telemetry.ts:40](https://github.com/btravers/amqp-contract/blob/
|
|
1143
|
-
| <a id="property-messaging_destination"></a> `MESSAGING_DESTINATION` | `"messaging.destination.name"` | `"messaging.destination.name"` | [packages/core/src/telemetry.ts:29](https://github.com/btravers/amqp-contract/blob/
|
|
1144
|
-
| <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/btravers/amqp-contract/blob/
|
|
1145
|
-
| <a id="property-messaging_destination_kind_exchange"></a> `MESSAGING_DESTINATION_KIND_EXCHANGE` | `"exchange"` | `"exchange"` | [packages/core/src/telemetry.ts:44](https://github.com/btravers/amqp-contract/blob/
|
|
1146
|
-
| <a id="property-messaging_destination_kind_queue"></a> `MESSAGING_DESTINATION_KIND_QUEUE` | `"queue"` | `"queue"` | [packages/core/src/telemetry.ts:45](https://github.com/btravers/amqp-contract/blob/
|
|
1147
|
-
| <a id="property-messaging_operation"></a> `MESSAGING_OPERATION` | `"messaging.operation"` | `"messaging.operation"` | [packages/core/src/telemetry.ts:31](https://github.com/btravers/amqp-contract/blob/
|
|
1148
|
-
| <a id="property-messaging_operation_process"></a> `MESSAGING_OPERATION_PROCESS` | `"process"` | `"process"` | [packages/core/src/telemetry.ts:47](https://github.com/btravers/amqp-contract/blob/
|
|
1149
|
-
| <a id="property-messaging_operation_publish"></a> `MESSAGING_OPERATION_PUBLISH` | `"publish"` | `"publish"` | [packages/core/src/telemetry.ts:46](https://github.com/btravers/amqp-contract/blob/
|
|
1150
|
-
| <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/btravers/amqp-contract/blob/
|
|
1151
|
-
| <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/btravers/amqp-contract/blob/
|
|
1152
|
-
| <a id="property-messaging_system"></a> `MESSAGING_SYSTEM` | `"messaging.system"` | `"messaging.system"` | [packages/core/src/telemetry.ts:28](https://github.com/btravers/amqp-contract/blob/
|
|
1153
|
-
| <a id="property-messaging_system_rabbitmq"></a> `MESSAGING_SYSTEM_RABBITMQ` | `"rabbitmq"` | `"rabbitmq"` | [packages/core/src/telemetry.ts:43](https://github.com/btravers/amqp-contract/blob/
|
|
1136
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L37) |
|
|
1137
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L36) |
|
|
1138
|
+
| <a id="property-error_type"></a> `ERROR_TYPE` | `"error.type"` | `"error.type"` | [packages/core/src/telemetry.ts:40](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L40) |
|
|
1139
|
+
| <a id="property-messaging_destination"></a> `MESSAGING_DESTINATION` | `"messaging.destination.name"` | `"messaging.destination.name"` | [packages/core/src/telemetry.ts:29](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L29) |
|
|
1140
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L30) |
|
|
1141
|
+
| <a id="property-messaging_destination_kind_exchange"></a> `MESSAGING_DESTINATION_KIND_EXCHANGE` | `"exchange"` | `"exchange"` | [packages/core/src/telemetry.ts:44](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L44) |
|
|
1142
|
+
| <a id="property-messaging_destination_kind_queue"></a> `MESSAGING_DESTINATION_KIND_QUEUE` | `"queue"` | `"queue"` | [packages/core/src/telemetry.ts:45](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L45) |
|
|
1143
|
+
| <a id="property-messaging_operation"></a> `MESSAGING_OPERATION` | `"messaging.operation"` | `"messaging.operation"` | [packages/core/src/telemetry.ts:31](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L31) |
|
|
1144
|
+
| <a id="property-messaging_operation_process"></a> `MESSAGING_OPERATION_PROCESS` | `"process"` | `"process"` | [packages/core/src/telemetry.ts:47](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L47) |
|
|
1145
|
+
| <a id="property-messaging_operation_publish"></a> `MESSAGING_OPERATION_PUBLISH` | `"publish"` | `"publish"` | [packages/core/src/telemetry.ts:46](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L46) |
|
|
1146
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L35) |
|
|
1147
|
+
| <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/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L34) |
|
|
1148
|
+
| <a id="property-messaging_system"></a> `MESSAGING_SYSTEM` | `"messaging.system"` | `"messaging.system"` | [packages/core/src/telemetry.ts:28](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L28) |
|
|
1149
|
+
| <a id="property-messaging_system_rabbitmq"></a> `MESSAGING_SYSTEM_RABBITMQ` | `"rabbitmq"` | `"rabbitmq"` | [packages/core/src/telemetry.ts:43](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L43) |
|
|
1154
1150
|
|
|
1155
1151
|
#### See
|
|
1156
1152
|
|
|
@@ -1164,7 +1160,7 @@ https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/
|
|
|
1164
1160
|
function endSpanError(span, error): void;
|
|
1165
1161
|
```
|
|
1166
1162
|
|
|
1167
|
-
Defined in: [packages/core/src/telemetry.ts:324](https://github.com/btravers/amqp-contract/blob/
|
|
1163
|
+
Defined in: [packages/core/src/telemetry.ts:324](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L324)
|
|
1168
1164
|
|
|
1169
1165
|
End a span with error status.
|
|
1170
1166
|
|
|
@@ -1187,7 +1183,7 @@ End a span with error status.
|
|
|
1187
1183
|
function endSpanSuccess(span): void;
|
|
1188
1184
|
```
|
|
1189
1185
|
|
|
1190
|
-
Defined in: [packages/core/src/telemetry.ts:309](https://github.com/btravers/amqp-contract/blob/
|
|
1186
|
+
Defined in: [packages/core/src/telemetry.ts:309](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L309)
|
|
1191
1187
|
|
|
1192
1188
|
End a span with success status.
|
|
1193
1189
|
|
|
@@ -1214,7 +1210,7 @@ function recordConsumeMetric(
|
|
|
1214
1210
|
durationMs): void;
|
|
1215
1211
|
```
|
|
1216
1212
|
|
|
1217
|
-
Defined in: [packages/core/src/telemetry.ts:368](https://github.com/btravers/amqp-contract/blob/
|
|
1213
|
+
Defined in: [packages/core/src/telemetry.ts:368](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L368)
|
|
1218
1214
|
|
|
1219
1215
|
Record a consume metric.
|
|
1220
1216
|
|
|
@@ -1240,7 +1236,7 @@ Record a consume metric.
|
|
|
1240
1236
|
function recordLateRpcReply(provider, reason): void;
|
|
1241
1237
|
```
|
|
1242
1238
|
|
|
1243
|
-
Defined in: [packages/core/src/telemetry.ts:398](https://github.com/btravers/amqp-contract/blob/
|
|
1239
|
+
Defined in: [packages/core/src/telemetry.ts:398](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L398)
|
|
1244
1240
|
|
|
1245
1241
|
Record an RPC reply that arrived after the caller stopped waiting.
|
|
1246
1242
|
|
|
@@ -1268,7 +1264,7 @@ function recordPublishMetric(
|
|
|
1268
1264
|
durationMs): void;
|
|
1269
1265
|
```
|
|
1270
1266
|
|
|
1271
|
-
Defined in: [packages/core/src/telemetry.ts:341](https://github.com/btravers/amqp-contract/blob/
|
|
1267
|
+
Defined in: [packages/core/src/telemetry.ts:341](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L341)
|
|
1272
1268
|
|
|
1273
1269
|
Record a publish metric.
|
|
1274
1270
|
|
|
@@ -1294,7 +1290,7 @@ Record a publish metric.
|
|
|
1294
1290
|
function setupAmqpTopology(channel, contract): Promise<void>;
|
|
1295
1291
|
```
|
|
1296
1292
|
|
|
1297
|
-
Defined in: [packages/core/src/setup.ts:26](https://github.com/btravers/amqp-contract/blob/
|
|
1293
|
+
Defined in: [packages/core/src/setup.ts:26](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/setup.ts#L26)
|
|
1298
1294
|
|
|
1299
1295
|
Setup AMQP topology (exchanges, queues, and bindings) from a contract definition.
|
|
1300
1296
|
|
|
@@ -1342,7 +1338,7 @@ function startConsumeSpan(
|
|
|
1342
1338
|
attributes?): Span | undefined;
|
|
1343
1339
|
```
|
|
1344
1340
|
|
|
1345
|
-
Defined in: [packages/core/src/telemetry.ts:277](https://github.com/btravers/amqp-contract/blob/
|
|
1341
|
+
Defined in: [packages/core/src/telemetry.ts:277](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L277)
|
|
1346
1342
|
|
|
1347
1343
|
Create a span for a consume/process operation.
|
|
1348
1344
|
Returns undefined if OpenTelemetry is not available.
|
|
@@ -1372,7 +1368,7 @@ function startPublishSpan(
|
|
|
1372
1368
|
attributes?): Span | undefined;
|
|
1373
1369
|
```
|
|
1374
1370
|
|
|
1375
|
-
Defined in: [packages/core/src/telemetry.ts:242](https://github.com/btravers/amqp-contract/blob/
|
|
1371
|
+
Defined in: [packages/core/src/telemetry.ts:242](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/core/src/telemetry.ts#L242)
|
|
1376
1372
|
|
|
1377
1373
|
Create a span for a publish operation.
|
|
1378
1374
|
Returns undefined if OpenTelemetry is not available.
|