@amqp-contract/contract 0.17.0 → 0.18.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/dist/index.cjs +65 -7
- package/dist/index.d.cts +181 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +181 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +65 -8
- package/dist/index.mjs.map +1 -1
- package/docs/index.md +274 -181
- package/package.json +2 -2
package/docs/index.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
type AnySchema = StandardSchemaV1;
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Defined in: [types.ts:12](https://github.com/btravers/amqp-contract/blob/
|
|
15
|
+
Defined in: [types.ts:12](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L12)
|
|
16
16
|
|
|
17
17
|
Any schema that conforms to Standard Schema v1.
|
|
18
18
|
|
|
@@ -32,7 +32,7 @@ https://github.com/standard-schema/standard-schema
|
|
|
32
32
|
type BaseExchangeDefinition<TName> = object;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Defined in: [types.ts:376](https://github.com/btravers/amqp-contract/blob/
|
|
35
|
+
Defined in: [types.ts:376](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L376)
|
|
36
36
|
|
|
37
37
|
Base definition of an AMQP exchange.
|
|
38
38
|
|
|
@@ -49,11 +49,11 @@ type and routing rules. This type contains properties common to all exchange typ
|
|
|
49
49
|
|
|
50
50
|
| Property | Type | Description | Defined in |
|
|
51
51
|
| ------ | ------ | ------ | ------ |
|
|
52
|
-
| <a id="arguments"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for advanced configuration. Common arguments include alternate-exchange for handling unroutable messages. | [types.ts:405](https://github.com/btravers/amqp-contract/blob/
|
|
53
|
-
| <a id="autodelete"></a> `autoDelete?` | `boolean` | If true, the exchange is deleted when all queues have finished using it. **Default** `false` | [types.ts:392](https://github.com/btravers/amqp-contract/blob/
|
|
54
|
-
| <a id="durable"></a> `durable?` | `boolean` | If true, the exchange survives broker restarts. Durable exchanges are persisted to disk. **Default** `false` | [types.ts:386](https://github.com/btravers/amqp-contract/blob/
|
|
55
|
-
| <a id="internal"></a> `internal?` | `boolean` | If true, the exchange cannot be directly published to by clients. It can only receive messages from other exchanges via exchange-to-exchange bindings. **Default** `false` | [types.ts:399](https://github.com/btravers/amqp-contract/blob/
|
|
56
|
-
| <a id="name"></a> `name` | `TName` | The name of the exchange. Must be unique within the RabbitMQ virtual host. | [types.ts:380](https://github.com/btravers/amqp-contract/blob/
|
|
52
|
+
| <a id="arguments"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for advanced configuration. Common arguments include alternate-exchange for handling unroutable messages. | [types.ts:405](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L405) |
|
|
53
|
+
| <a id="autodelete"></a> `autoDelete?` | `boolean` | If true, the exchange is deleted when all queues have finished using it. **Default** `false` | [types.ts:392](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L392) |
|
|
54
|
+
| <a id="durable"></a> `durable?` | `boolean` | If true, the exchange survives broker restarts. Durable exchanges are persisted to disk. **Default** `false` | [types.ts:386](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L386) |
|
|
55
|
+
| <a id="internal"></a> `internal?` | `boolean` | If true, the exchange cannot be directly published to by clients. It can only receive messages from other exchanges via exchange-to-exchange bindings. **Default** `false` | [types.ts:399](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L399) |
|
|
56
|
+
| <a id="name"></a> `name` | `TName` | The name of the exchange. Must be unique within the RabbitMQ virtual host. | [types.ts:380](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L380) |
|
|
57
57
|
|
|
58
58
|
***
|
|
59
59
|
|
|
@@ -65,7 +65,7 @@ type BindingDefinition =
|
|
|
65
65
|
| ExchangeBindingDefinition;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Defined in: [types.ts:831](https://github.com/btravers/amqp-contract/blob/
|
|
68
|
+
Defined in: [types.ts:831](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L831)
|
|
69
69
|
|
|
70
70
|
Union type of all binding definitions.
|
|
71
71
|
|
|
@@ -81,7 +81,7 @@ A binding can be either:
|
|
|
81
81
|
type BindingPattern<S> = S extends "" ? never : S;
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
Defined in: [builder/routing-types.ts:52](https://github.com/btravers/amqp-contract/blob/
|
|
84
|
+
Defined in: [builder/routing-types.ts:52](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/routing-types.ts#L52)
|
|
85
85
|
|
|
86
86
|
Type-safe binding pattern that validates basic format and wildcards.
|
|
87
87
|
|
|
@@ -110,13 +110,75 @@ type Invalid = BindingPattern<"">; // never (empty string)
|
|
|
110
110
|
|
|
111
111
|
***
|
|
112
112
|
|
|
113
|
+
### BridgedPublisherConfig
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
type BridgedPublisherConfig<TMessage, TBridgeExchange, TTargetExchange> = object;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Defined in: [builder/command.ts:66](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L66)
|
|
120
|
+
|
|
121
|
+
Configuration for a bridged command publisher.
|
|
122
|
+
|
|
123
|
+
A bridged publisher publishes to a bridge exchange (local domain), which forwards
|
|
124
|
+
messages to the target exchange (remote domain) via an exchange-to-exchange binding.
|
|
125
|
+
|
|
126
|
+
#### Type Parameters
|
|
127
|
+
|
|
128
|
+
| Type Parameter | Description |
|
|
129
|
+
| ------ | ------ |
|
|
130
|
+
| `TMessage` *extends* [`MessageDefinition`](#messagedefinition) | The message definition |
|
|
131
|
+
| `TBridgeExchange` *extends* [`ExchangeDefinition`](#exchangedefinition) | The bridge (local domain) exchange definition |
|
|
132
|
+
| `TTargetExchange` *extends* [`ExchangeDefinition`](#exchangedefinition) | The target (remote domain) exchange definition |
|
|
133
|
+
|
|
134
|
+
#### Properties
|
|
135
|
+
|
|
136
|
+
| Property | Type | Description | Defined in |
|
|
137
|
+
| ------ | ------ | ------ | ------ |
|
|
138
|
+
| <a id="__brand"></a> `__brand` | `"BridgedPublisherConfig"` | Discriminator to identify this as a bridged publisher config | [builder/command.ts:72](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L72) |
|
|
139
|
+
| <a id="bridgeexchange"></a> `bridgeExchange` | `TBridgeExchange` | The bridge (local domain) exchange | [builder/command.ts:78](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L78) |
|
|
140
|
+
| <a id="exchangebinding"></a> `exchangeBinding` | [`ExchangeBindingDefinition`](#exchangebindingdefinition) | The exchange-to-exchange binding (bridge → target) | [builder/command.ts:76](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L76) |
|
|
141
|
+
| <a id="publisher"></a> `publisher` | [`PublisherDefinition`](#publisherdefinition)<`TMessage`> | The publisher definition (publishes to bridge exchange) | [builder/command.ts:74](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L74) |
|
|
142
|
+
| <a id="targetexchange"></a> `targetExchange` | `TTargetExchange` | The target (remote domain) exchange | [builder/command.ts:80](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L80) |
|
|
143
|
+
|
|
144
|
+
***
|
|
145
|
+
|
|
146
|
+
### BridgedPublisherConfigBase
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
type BridgedPublisherConfigBase = object;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Defined in: [types.ts:966](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L966)
|
|
153
|
+
|
|
154
|
+
Base type for bridged publisher configuration.
|
|
155
|
+
|
|
156
|
+
A bridged publisher publishes to a bridge exchange, which forwards messages
|
|
157
|
+
to the target exchange via an exchange-to-exchange binding.
|
|
158
|
+
|
|
159
|
+
#### See
|
|
160
|
+
|
|
161
|
+
defineCommandPublisher with bridgeExchange option
|
|
162
|
+
|
|
163
|
+
#### Properties
|
|
164
|
+
|
|
165
|
+
| Property | Type | Defined in |
|
|
166
|
+
| ------ | ------ | ------ |
|
|
167
|
+
| <a id="__brand-1"></a> `__brand` | `"BridgedPublisherConfig"` | [types.ts:967](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L967) |
|
|
168
|
+
| <a id="bridgeexchange-1"></a> `bridgeExchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:970](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L970) |
|
|
169
|
+
| <a id="exchangebinding-1"></a> `exchangeBinding` | [`ExchangeBindingDefinition`](#exchangebindingdefinition) | [types.ts:969](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L969) |
|
|
170
|
+
| <a id="publisher-1"></a> `publisher` | [`PublisherDefinition`](#publisherdefinition) | [types.ts:968](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L968) |
|
|
171
|
+
| <a id="targetexchange-1"></a> `targetExchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:971](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L971) |
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
113
175
|
### ClassicQueueDefinition
|
|
114
176
|
|
|
115
177
|
```ts
|
|
116
178
|
type ClassicQueueDefinition<TName> = BaseQueueDefinition<TName> & object;
|
|
117
179
|
```
|
|
118
180
|
|
|
119
|
-
Defined in: [types.ts:595](https://github.com/btravers/amqp-contract/blob/
|
|
181
|
+
Defined in: [types.ts:595](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L595)
|
|
120
182
|
|
|
121
183
|
Definition of a classic queue.
|
|
122
184
|
|
|
@@ -127,10 +189,10 @@ specific features not supported by quorum queues (e.g., exclusive queues, priori
|
|
|
127
189
|
|
|
128
190
|
| Name | Type | Description | Defined in |
|
|
129
191
|
| ------ | ------ | ------ | ------ |
|
|
130
|
-
| `deliveryLimit?` | `never` | Classic queues do not support delivery limits. Use type: 'quorum' if you need native retry with delivery limits. | [types.ts:605](https://github.com/btravers/amqp-contract/blob/
|
|
131
|
-
| `exclusive?` | `boolean` | If true, the queue can only be used by the declaring connection and is deleted when that connection closes. Exclusive queues are private to the connection. **Default** `false` | [types.ts:612](https://github.com/btravers/amqp-contract/blob/
|
|
132
|
-
| `retry` | `ResolvedTtlBackoffRetryOptions` | Retry configuration for handling failed message processing. Classic queues only support TTL-backoff retry mode (default). When the queue is created, defaults are applied. | [types.ts:620](https://github.com/btravers/amqp-contract/blob/
|
|
133
|
-
| `type` | `"classic"` | Queue type discriminator: classic queue. | [types.ts:599](https://github.com/btravers/amqp-contract/blob/
|
|
192
|
+
| `deliveryLimit?` | `never` | Classic queues do not support delivery limits. Use type: 'quorum' if you need native retry with delivery limits. | [types.ts:605](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L605) |
|
|
193
|
+
| `exclusive?` | `boolean` | If true, the queue can only be used by the declaring connection and is deleted when that connection closes. Exclusive queues are private to the connection. **Default** `false` | [types.ts:612](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L612) |
|
|
194
|
+
| `retry` | `ResolvedTtlBackoffRetryOptions` | Retry configuration for handling failed message processing. Classic queues only support TTL-backoff retry mode (default). When the queue is created, defaults are applied. | [types.ts:620](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L620) |
|
|
195
|
+
| `type` | `"classic"` | Queue type discriminator: classic queue. | [types.ts:599](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L599) |
|
|
134
196
|
|
|
135
197
|
#### Type Parameters
|
|
136
198
|
|
|
@@ -146,7 +208,7 @@ specific features not supported by quorum queues (e.g., exclusive queues, priori
|
|
|
146
208
|
type ClassicQueueOptions = BaseQueueOptions & object;
|
|
147
209
|
```
|
|
148
210
|
|
|
149
|
-
Defined in: [types.ts:318](https://github.com/btravers/amqp-contract/blob/
|
|
211
|
+
Defined in: [types.ts:318](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L318)
|
|
150
212
|
|
|
151
213
|
Options for creating a classic queue.
|
|
152
214
|
|
|
@@ -159,10 +221,10 @@ Classic queues support all traditional RabbitMQ features including:
|
|
|
159
221
|
|
|
160
222
|
| Name | Type | Description | Defined in |
|
|
161
223
|
| ------ | ------ | ------ | ------ |
|
|
162
|
-
| `exclusive?` | `boolean` | If true, the queue can only be used by the declaring connection and is deleted when that connection closes. Exclusive queues are private to the connection. **Default** `false` | [types.ts:329](https://github.com/btravers/amqp-contract/blob/
|
|
163
|
-
| `maxPriority?` | `number` | Maximum priority level for priority queue (1-255, recommended: 1-10). Sets x-max-priority argument. Only supported with classic queues. | [types.ts:336](https://github.com/btravers/amqp-contract/blob/
|
|
164
|
-
| `retry?` | [`TtlBackoffRetryOptions`](#ttlbackoffretryoptions) | Retry configuration for handling failed message processing. Classic queues only support TTL-backoff retry mode, which uses wait queues with exponential backoff. For quorum-native retry, use quorum queues instead. **Example** `const orderQueue = defineQueue('order-processing', { type: 'classic', durable: true, deadLetter: { exchange: dlx }, retry: { maxRetries: 5, initialDelayMs: 1000, maxDelayMs: 30000, }, });` | [types.ts:358](https://github.com/btravers/amqp-contract/blob/
|
|
165
|
-
| `type` | `"classic"` | Queue type: classic (for special cases) | [types.ts:322](https://github.com/btravers/amqp-contract/blob/
|
|
224
|
+
| `exclusive?` | `boolean` | If true, the queue can only be used by the declaring connection and is deleted when that connection closes. Exclusive queues are private to the connection. **Default** `false` | [types.ts:329](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L329) |
|
|
225
|
+
| `maxPriority?` | `number` | Maximum priority level for priority queue (1-255, recommended: 1-10). Sets x-max-priority argument. Only supported with classic queues. | [types.ts:336](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L336) |
|
|
226
|
+
| `retry?` | [`TtlBackoffRetryOptions`](#ttlbackoffretryoptions) | Retry configuration for handling failed message processing. Classic queues only support TTL-backoff retry mode, which uses wait queues with exponential backoff. For quorum-native retry, use quorum queues instead. **Example** `const orderQueue = defineQueue('order-processing', { type: 'classic', durable: true, deadLetter: { exchange: dlx }, retry: { maxRetries: 5, initialDelayMs: 1000, maxDelayMs: 30000, }, });` | [types.ts:358](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L358) |
|
|
227
|
+
| `type` | `"classic"` | Queue type: classic (for special cases) | [types.ts:322](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L322) |
|
|
166
228
|
|
|
167
229
|
#### Example
|
|
168
230
|
|
|
@@ -182,7 +244,7 @@ const priorityQueue = defineQueue('tasks', {
|
|
|
182
244
|
type CommandConsumerConfig<TMessage, TExchange, TRoutingKey, TQueue, TDlxExchange> = object;
|
|
183
245
|
```
|
|
184
246
|
|
|
185
|
-
Defined in: [builder/command.ts:
|
|
247
|
+
Defined in: [builder/command.ts:31](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L31)
|
|
186
248
|
|
|
187
249
|
Configuration for a command consumer.
|
|
188
250
|
|
|
@@ -203,14 +265,14 @@ The consumer "owns" the queue, and publishers send commands to it.
|
|
|
203
265
|
|
|
204
266
|
| Property | Type | Description | Defined in |
|
|
205
267
|
| ------ | ------ | ------ | ------ |
|
|
206
|
-
| <a id="__brand"></a> `__brand` | `"CommandConsumerConfig"` | Discriminator to identify this as a command consumer config | [builder/command.ts:
|
|
207
|
-
| <a id="binding"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | The binding connecting the queue to the exchange | [builder/command.ts:
|
|
208
|
-
| <a id="consumer"></a> `consumer` | [`ConsumerDefinition`](#consumerdefinition)<`TMessage`> | The consumer definition for processing commands | [builder/command.ts:
|
|
209
|
-
| <a id="deadletterexchange"></a> `deadLetterExchange` | `TDlxExchange` | The dead letter exchange from the queue, if configured | [builder/command.ts:
|
|
210
|
-
| <a id="exchange"></a> `exchange` | `TExchange` | The exchange that receives commands | [builder/command.ts:
|
|
211
|
-
| <a id="message"></a> `message` | `TMessage` | The message definition | [builder/command.ts:
|
|
212
|
-
| <a id="queue"></a> `queue` | `TQueue` | The queue this consumer reads from | [builder/command.ts:
|
|
213
|
-
| <a id="routingkey"></a> `routingKey` | `TRoutingKey` | The routing key pattern for the binding | [builder/command.ts:
|
|
268
|
+
| <a id="__brand-2"></a> `__brand` | `"CommandConsumerConfig"` | Discriminator to identify this as a command consumer config | [builder/command.ts:39](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L39) |
|
|
269
|
+
| <a id="binding"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | The binding connecting the queue to the exchange | [builder/command.ts:43](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L43) |
|
|
270
|
+
| <a id="consumer"></a> `consumer` | [`ConsumerDefinition`](#consumerdefinition)<`TMessage`> | The consumer definition for processing commands | [builder/command.ts:41](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L41) |
|
|
271
|
+
| <a id="deadletterexchange"></a> `deadLetterExchange` | `TDlxExchange` | The dead letter exchange from the queue, if configured | [builder/command.ts:49](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L49) |
|
|
272
|
+
| <a id="exchange"></a> `exchange` | `TExchange` | The exchange that receives commands | [builder/command.ts:45](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L45) |
|
|
273
|
+
| <a id="message"></a> `message` | `TMessage` | The message definition | [builder/command.ts:51](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L51) |
|
|
274
|
+
| <a id="queue"></a> `queue` | `TQueue` | The queue this consumer reads from | [builder/command.ts:47](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L47) |
|
|
275
|
+
| <a id="routingkey"></a> `routingKey` | `TRoutingKey` | The routing key pattern for the binding | [builder/command.ts:53](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L53) |
|
|
214
276
|
|
|
215
277
|
***
|
|
216
278
|
|
|
@@ -220,7 +282,7 @@ The consumer "owns" the queue, and publishers send commands to it.
|
|
|
220
282
|
type CommandConsumerConfigBase = object;
|
|
221
283
|
```
|
|
222
284
|
|
|
223
|
-
Defined in: [types.ts:928](https://github.com/btravers/amqp-contract/blob/
|
|
285
|
+
Defined in: [types.ts:928](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L928)
|
|
224
286
|
|
|
225
287
|
Base type for command consumer configuration.
|
|
226
288
|
|
|
@@ -235,14 +297,14 @@ defineCommandConsumer for creating command consumers
|
|
|
235
297
|
|
|
236
298
|
| Property | Type | Defined in |
|
|
237
299
|
| ------ | ------ | ------ |
|
|
238
|
-
| <a id="__brand-
|
|
239
|
-
| <a id="binding-1"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | [types.ts:931](https://github.com/btravers/amqp-contract/blob/
|
|
240
|
-
| <a id="consumer-1"></a> `consumer` | [`ConsumerDefinition`](#consumerdefinition) | [types.ts:930](https://github.com/btravers/amqp-contract/blob/
|
|
241
|
-
| <a id="deadletterexchange-1"></a> `deadLetterExchange` | [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | [types.ts:934](https://github.com/btravers/amqp-contract/blob/
|
|
242
|
-
| <a id="exchange-1"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:932](https://github.com/btravers/amqp-contract/blob/
|
|
243
|
-
| <a id="message-1"></a> `message` | [`MessageDefinition`](#messagedefinition) | [types.ts:935](https://github.com/btravers/amqp-contract/blob/
|
|
244
|
-
| <a id="queue-1"></a> `queue` | [`QueueDefinition`](#queuedefinition) | [types.ts:933](https://github.com/btravers/amqp-contract/blob/
|
|
245
|
-
| <a id="routingkey-1"></a> `routingKey` | `string` \| `undefined` | [types.ts:936](https://github.com/btravers/amqp-contract/blob/
|
|
300
|
+
| <a id="__brand-3"></a> `__brand` | `"CommandConsumerConfig"` | [types.ts:929](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L929) |
|
|
301
|
+
| <a id="binding-1"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | [types.ts:931](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L931) |
|
|
302
|
+
| <a id="consumer-1"></a> `consumer` | [`ConsumerDefinition`](#consumerdefinition) | [types.ts:930](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L930) |
|
|
303
|
+
| <a id="deadletterexchange-1"></a> `deadLetterExchange` | [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | [types.ts:934](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L934) |
|
|
304
|
+
| <a id="exchange-1"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:932](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L932) |
|
|
305
|
+
| <a id="message-1"></a> `message` | [`MessageDefinition`](#messagedefinition) | [types.ts:935](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L935) |
|
|
306
|
+
| <a id="queue-1"></a> `queue` | [`QueueDefinition`](#queuedefinition) | [types.ts:933](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L933) |
|
|
307
|
+
| <a id="routingkey-1"></a> `routingKey` | `string` \| `undefined` | [types.ts:936](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L936) |
|
|
246
308
|
|
|
247
309
|
***
|
|
248
310
|
|
|
@@ -252,7 +314,7 @@ defineCommandConsumer for creating command consumers
|
|
|
252
314
|
type CompressionAlgorithm = "gzip" | "deflate";
|
|
253
315
|
```
|
|
254
316
|
|
|
255
|
-
Defined in: [types.ts:134](https://github.com/btravers/amqp-contract/blob/
|
|
317
|
+
Defined in: [types.ts:134](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L134)
|
|
256
318
|
|
|
257
319
|
Supported compression algorithms for message payloads.
|
|
258
320
|
|
|
@@ -290,7 +352,7 @@ await client.publish("orderCreated", payload, {
|
|
|
290
352
|
type ConsumerDefinition<TMessage> = object;
|
|
291
353
|
```
|
|
292
354
|
|
|
293
|
-
Defined in: [types.ts:892](https://github.com/btravers/amqp-contract/blob/
|
|
355
|
+
Defined in: [types.ts:892](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L892)
|
|
294
356
|
|
|
295
357
|
Definition of a message consumer.
|
|
296
358
|
|
|
@@ -318,8 +380,8 @@ const consumer: ConsumerDefinition = {
|
|
|
318
380
|
|
|
319
381
|
| Property | Type | Description | Defined in |
|
|
320
382
|
| ------ | ------ | ------ | ------ |
|
|
321
|
-
| <a id="message-2"></a> `message` | `TMessage` | The message definition including the payload schema | [types.ts:897](https://github.com/btravers/amqp-contract/blob/
|
|
322
|
-
| <a id="queue-2"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The queue to consume messages from | [types.ts:894](https://github.com/btravers/amqp-contract/blob/
|
|
383
|
+
| <a id="message-2"></a> `message` | `TMessage` | The message definition including the payload schema | [types.ts:897](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L897) |
|
|
384
|
+
| <a id="queue-2"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The queue to consume messages from | [types.ts:894](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L894) |
|
|
323
385
|
|
|
324
386
|
***
|
|
325
387
|
|
|
@@ -332,7 +394,7 @@ type ConsumerEntry =
|
|
|
332
394
|
| CommandConsumerConfigBase;
|
|
333
395
|
```
|
|
334
396
|
|
|
335
|
-
Defined in: [types.ts:
|
|
397
|
+
Defined in: [types.ts:1064](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1064)
|
|
336
398
|
|
|
337
399
|
Consumer entry that can be passed to defineContract's consumers section.
|
|
338
400
|
|
|
@@ -349,7 +411,7 @@ Can be either:
|
|
|
349
411
|
type ContractDefinition = object;
|
|
350
412
|
```
|
|
351
413
|
|
|
352
|
-
Defined in: [types.ts:
|
|
414
|
+
Defined in: [types.ts:1007](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1007)
|
|
353
415
|
|
|
354
416
|
Complete AMQP contract definition (output type).
|
|
355
417
|
|
|
@@ -388,11 +450,11 @@ const contract: ContractDefinition = {
|
|
|
388
450
|
|
|
389
451
|
| Property | Type | Description | Defined in |
|
|
390
452
|
| ------ | ------ | ------ | ------ |
|
|
391
|
-
| <a id="bindings"></a> `bindings?` | `Record`<`string`, [`BindingDefinition`](#bindingdefinition)> | Named binding definitions. Bindings can be queue-to-exchange or exchange-to-exchange. | [types.ts:
|
|
392
|
-
| <a id="consumers"></a> `consumers?` | `Record`<`string`, [`ConsumerDefinition`](#consumerdefinition)> | Named consumer definitions. Each key requires a corresponding handler in the TypedAmqpWorker. The handler will be fully typed based on the message schema. | [types.ts:
|
|
393
|
-
| <a id="exchanges"></a> `exchanges?` | `Record`<`string`, [`ExchangeDefinition`](#exchangedefinition)> | Named exchange definitions. Each key becomes available as a named resource in the contract. | [types.ts:
|
|
394
|
-
| <a id="publishers"></a> `publishers?` | `Record`<`string`, [`PublisherDefinition`](#publisherdefinition)> | Named publisher definitions. Each key becomes a method on the TypedAmqpClient for publishing messages. The method will be fully typed based on the message schema. | [types.ts:
|
|
395
|
-
| <a id="queues"></a> `queues?` | `Record`<`string`, [`QueueEntry`](#queueentry)> | Named queue definitions. Each key becomes available as a named resource in the contract. When a queue has TTL-backoff retry configured, pass the `QueueWithTtlBackoffInfrastructure` object returned by `defineQueue`. The wait queue and bindings will be automatically added. | [types.ts:
|
|
453
|
+
| <a id="bindings"></a> `bindings?` | `Record`<`string`, [`BindingDefinition`](#bindingdefinition)> | Named binding definitions. Bindings can be queue-to-exchange or exchange-to-exchange. | [types.ts:1027](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1027) |
|
|
454
|
+
| <a id="consumers"></a> `consumers?` | `Record`<`string`, [`ConsumerDefinition`](#consumerdefinition)> | Named consumer definitions. Each key requires a corresponding handler in the TypedAmqpWorker. The handler will be fully typed based on the message schema. | [types.ts:1041](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1041) |
|
|
455
|
+
| <a id="exchanges"></a> `exchanges?` | `Record`<`string`, [`ExchangeDefinition`](#exchangedefinition)> | Named exchange definitions. Each key becomes available as a named resource in the contract. | [types.ts:1012](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1012) |
|
|
456
|
+
| <a id="publishers"></a> `publishers?` | `Record`<`string`, [`PublisherDefinition`](#publisherdefinition)> | Named publisher definitions. Each key becomes a method on the TypedAmqpClient for publishing messages. The method will be fully typed based on the message schema. | [types.ts:1034](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1034) |
|
|
457
|
+
| <a id="queues"></a> `queues?` | `Record`<`string`, [`QueueEntry`](#queueentry)> | Named queue definitions. Each key becomes available as a named resource in the contract. When a queue has TTL-backoff retry configured, pass the `QueueWithTtlBackoffInfrastructure` object returned by `defineQueue`. The wait queue and bindings will be automatically added. | [types.ts:1021](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1021) |
|
|
396
458
|
|
|
397
459
|
***
|
|
398
460
|
|
|
@@ -402,7 +464,7 @@ const contract: ContractDefinition = {
|
|
|
402
464
|
type ContractDefinitionInput = object;
|
|
403
465
|
```
|
|
404
466
|
|
|
405
|
-
Defined in: [types.ts:
|
|
467
|
+
Defined in: [types.ts:1093](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1093)
|
|
406
468
|
|
|
407
469
|
Contract definition input type with automatic extraction of event/command patterns.
|
|
408
470
|
|
|
@@ -434,8 +496,8 @@ defineContract - Processes this input and returns a ContractDefinition
|
|
|
434
496
|
|
|
435
497
|
| Property | Type | Description | Defined in |
|
|
436
498
|
| ------ | ------ | ------ | ------ |
|
|
437
|
-
| <a id="consumers-1"></a> `consumers?` | `Record`<`string`, [`ConsumerEntry`](#consumerentry)> | Named consumer definitions. Can accept: - ConsumerDefinition from defineConsumer - EventConsumerResult from defineEventConsumer (binding auto-extracted) - CommandConsumerConfig from defineCommandConsumer (binding auto-extracted) | [types.ts:
|
|
438
|
-
| <a id="publishers-1"></a> `publishers?` | `Record`<`string`, [`PublisherEntry`](#publisherentry)> | Named publisher definitions. Can accept: - PublisherDefinition from definePublisher - EventPublisherConfig from defineEventPublisher (auto-extracted to publisher) | [types.ts:
|
|
499
|
+
| <a id="consumers-1"></a> `consumers?` | `Record`<`string`, [`ConsumerEntry`](#consumerentry)> | Named consumer definitions. Can accept: - ConsumerDefinition from defineConsumer - EventConsumerResult from defineEventConsumer (binding auto-extracted) - CommandConsumerConfig from defineCommandConsumer (binding auto-extracted) | [types.ts:1111](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1111) |
|
|
500
|
+
| <a id="publishers-1"></a> `publishers?` | `Record`<`string`, [`PublisherEntry`](#publisherentry)> | Named publisher definitions. Can accept: - PublisherDefinition from definePublisher - EventPublisherConfig from defineEventPublisher (auto-extracted to publisher) | [types.ts:1101](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1101) |
|
|
439
501
|
|
|
440
502
|
***
|
|
441
503
|
|
|
@@ -445,7 +507,7 @@ defineContract - Processes this input and returns a ContractDefinition
|
|
|
445
507
|
type ContractOutput<TContract> = object;
|
|
446
508
|
```
|
|
447
509
|
|
|
448
|
-
Defined in: [types.ts:
|
|
510
|
+
Defined in: [types.ts:1420](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1420)
|
|
449
511
|
|
|
450
512
|
Contract output type with all resources extracted and properly typed.
|
|
451
513
|
|
|
@@ -466,11 +528,11 @@ This type represents the fully expanded contract with:
|
|
|
466
528
|
|
|
467
529
|
| Property | Type | Defined in |
|
|
468
530
|
| ------ | ------ | ------ |
|
|
469
|
-
| <a id="bindings-1"></a> `bindings` | `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractBindingsFromConsumers`<`TContract`\[`"consumers"`\]> : `object` | [types.ts:
|
|
470
|
-
| <a id="consumers-2"></a> `consumers` | `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractConsumerDefinitions`<`TContract`\[`"consumers"`\]> : `object` | [types.ts:
|
|
471
|
-
| <a id="exchanges-1"></a> `exchanges` | `TContract`\[`"publishers"`\] *extends* `Record`<`string`, [`PublisherEntry`](#publisherentry)> ? `ExtractExchangesFromPublishers`<`TContract`\[`"publishers"`\]> : `object` & `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractExchangesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` & `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractDeadLetterExchangesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` | [types.ts:
|
|
472
|
-
| <a id="publishers-2"></a> `publishers` | `TContract`\[`"publishers"`\] *extends* `Record`<`string`, [`PublisherEntry`](#publisherentry)> ? `ExtractPublisherDefinitions`<`TContract`\[`"publishers"`\]> : `object` | [types.ts:
|
|
473
|
-
| <a id="queues-1"></a> `queues` | `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractQueuesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` | [types.ts:
|
|
531
|
+
| <a id="bindings-1"></a> `bindings` | `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractBindingsFromConsumers`<`TContract`\[`"consumers"`\]> : `object` & `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractExchangeBindingsFromConsumers`<`TContract`\[`"consumers"`\]> : `object` & `TContract`\[`"publishers"`\] *extends* `Record`<`string`, [`PublisherEntry`](#publisherentry)> ? `ExtractExchangeBindingsFromPublishers`<`TContract`\[`"publishers"`\]> : `object` | [types.ts:1439](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1439) |
|
|
532
|
+
| <a id="consumers-2"></a> `consumers` | `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractConsumerDefinitions`<`TContract`\[`"consumers"`\]> : `object` | [types.ts:1451](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1451) |
|
|
533
|
+
| <a id="exchanges-1"></a> `exchanges` | `TContract`\[`"publishers"`\] *extends* `Record`<`string`, [`PublisherEntry`](#publisherentry)> ? `ExtractExchangesFromPublishers`<`TContract`\[`"publishers"`\]> : `object` & `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractExchangesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` & `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractDeadLetterExchangesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` & `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractBridgeExchangesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` & `TContract`\[`"publishers"`\] *extends* `Record`<`string`, [`PublisherEntry`](#publisherentry)> ? `ExtractTargetExchangesFromPublishers`<`TContract`\[`"publishers"`\]> : `object` | [types.ts:1421](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1421) |
|
|
534
|
+
| <a id="publishers-2"></a> `publishers` | `TContract`\[`"publishers"`\] *extends* `Record`<`string`, [`PublisherEntry`](#publisherentry)> ? `ExtractPublisherDefinitions`<`TContract`\[`"publishers"`\]> : `object` | [types.ts:1448](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1448) |
|
|
535
|
+
| <a id="queues-1"></a> `queues` | `TContract`\[`"consumers"`\] *extends* `Record`<`string`, [`ConsumerEntry`](#consumerentry)> ? `ExtractQueuesFromConsumers`<`TContract`\[`"consumers"`\]> : `object` | [types.ts:1436](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1436) |
|
|
474
536
|
|
|
475
537
|
***
|
|
476
538
|
|
|
@@ -480,7 +542,7 @@ This type represents the fully expanded contract with:
|
|
|
480
542
|
type DeadLetterConfig = object;
|
|
481
543
|
```
|
|
482
544
|
|
|
483
|
-
Defined in: [types.ts:483](https://github.com/btravers/amqp-contract/blob/
|
|
545
|
+
Defined in: [types.ts:483](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L483)
|
|
484
546
|
|
|
485
547
|
Configuration for dead letter exchange (DLX) on a queue.
|
|
486
548
|
|
|
@@ -492,8 +554,8 @@ or storage.
|
|
|
492
554
|
|
|
493
555
|
| Property | Type | Description | Defined in |
|
|
494
556
|
| ------ | ------ | ------ | ------ |
|
|
495
|
-
| <a id="exchange-2"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | The exchange to send dead-lettered messages to. This exchange must be declared in the contract. | [types.ts:488](https://github.com/btravers/amqp-contract/blob/
|
|
496
|
-
| <a id="routingkey-2"></a> `routingKey?` | `string` | Optional routing key to use when forwarding messages to the dead letter exchange. If not specified, the original message routing key is used. | [types.ts:494](https://github.com/btravers/amqp-contract/blob/
|
|
557
|
+
| <a id="exchange-2"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | The exchange to send dead-lettered messages to. This exchange must be declared in the contract. | [types.ts:488](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L488) |
|
|
558
|
+
| <a id="routingkey-2"></a> `routingKey?` | `string` | Optional routing key to use when forwarding messages to the dead letter exchange. If not specified, the original message routing key is used. | [types.ts:494](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L494) |
|
|
497
559
|
|
|
498
560
|
***
|
|
499
561
|
|
|
@@ -505,7 +567,7 @@ type DefineQueueOptions =
|
|
|
505
567
|
| ClassicQueueOptions;
|
|
506
568
|
```
|
|
507
569
|
|
|
508
|
-
Defined in: [types.ts:368](https://github.com/btravers/amqp-contract/blob/
|
|
570
|
+
Defined in: [types.ts:368](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L368)
|
|
509
571
|
|
|
510
572
|
Options for defining a queue. Uses a discriminated union based on the `type` property
|
|
511
573
|
to enforce quorum queue constraints at compile time.
|
|
@@ -521,7 +583,7 @@ to enforce quorum queue constraints at compile time.
|
|
|
521
583
|
type DefineQuorumQueueOptions = object;
|
|
522
584
|
```
|
|
523
585
|
|
|
524
|
-
Defined in: [builder/queue.ts:390](https://github.com/btravers/amqp-contract/blob/
|
|
586
|
+
Defined in: [builder/queue.ts:390](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L390)
|
|
525
587
|
|
|
526
588
|
Options for creating a quorum queue with quorum-native retry.
|
|
527
589
|
|
|
@@ -533,10 +595,10 @@ This simplified helper enforces the required configuration for quorum-native ret
|
|
|
533
595
|
|
|
534
596
|
| Property | Type | Description | Defined in |
|
|
535
597
|
| ------ | ------ | ------ | ------ |
|
|
536
|
-
| <a id="arguments-1"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for advanced configuration. | [builder/queue.ts:412](https://github.com/btravers/amqp-contract/blob/
|
|
537
|
-
| <a id="autodelete-1"></a> `autoDelete?` | `boolean` | If true, the queue is deleted when the last consumer unsubscribes. **Default** `false` | [builder/queue.ts:407](https://github.com/btravers/amqp-contract/blob/
|
|
538
|
-
| <a id="deadletter"></a> `deadLetter` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration - required for retry support. Failed messages will be sent to this exchange. | [builder/queue.ts:395](https://github.com/btravers/amqp-contract/blob/
|
|
539
|
-
| <a id="deliverylimit"></a> `deliveryLimit` | `number` | Maximum number of delivery attempts before dead-lettering. **Minimum** 1 | [builder/queue.ts:401](https://github.com/btravers/amqp-contract/blob/
|
|
598
|
+
| <a id="arguments-1"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for advanced configuration. | [builder/queue.ts:412](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L412) |
|
|
599
|
+
| <a id="autodelete-1"></a> `autoDelete?` | `boolean` | If true, the queue is deleted when the last consumer unsubscribes. **Default** `false` | [builder/queue.ts:407](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L407) |
|
|
600
|
+
| <a id="deadletter"></a> `deadLetter` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration - required for retry support. Failed messages will be sent to this exchange. | [builder/queue.ts:395](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L395) |
|
|
601
|
+
| <a id="deliverylimit"></a> `deliveryLimit` | `number` | Maximum number of delivery attempts before dead-lettering. **Minimum** 1 | [builder/queue.ts:401](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L401) |
|
|
540
602
|
|
|
541
603
|
***
|
|
542
604
|
|
|
@@ -546,7 +608,7 @@ This simplified helper enforces the required configuration for quorum-native ret
|
|
|
546
608
|
type DefineTtlBackoffQueueOptions = object;
|
|
547
609
|
```
|
|
548
610
|
|
|
549
|
-
Defined in: [builder/queue.ts:477](https://github.com/btravers/amqp-contract/blob/
|
|
611
|
+
Defined in: [builder/queue.ts:477](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L477)
|
|
550
612
|
|
|
551
613
|
Options for creating a queue with TTL-backoff retry.
|
|
552
614
|
|
|
@@ -558,14 +620,14 @@ This simplified helper enforces the required configuration for TTL-backoff retry
|
|
|
558
620
|
|
|
559
621
|
| Property | Type | Description | Defined in |
|
|
560
622
|
| ------ | ------ | ------ | ------ |
|
|
561
|
-
| <a id="arguments-2"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for advanced configuration. | [builder/queue.ts:523](https://github.com/btravers/amqp-contract/blob/
|
|
562
|
-
| <a id="autodelete-2"></a> `autoDelete?` | `boolean` | If true, the queue is deleted when the last consumer unsubscribes. **Default** `false` | [builder/queue.ts:518](https://github.com/btravers/amqp-contract/blob/
|
|
563
|
-
| <a id="backoffmultiplier"></a> `backoffMultiplier?` | `number` | Exponential backoff multiplier. **Default** `2` | [builder/queue.ts:506](https://github.com/btravers/amqp-contract/blob/
|
|
564
|
-
| <a id="deadletter-1"></a> `deadLetter` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration - required for TTL-backoff retry. Used for routing messages to the wait queue and back. | [builder/queue.ts:482](https://github.com/btravers/amqp-contract/blob/
|
|
565
|
-
| <a id="initialdelayms"></a> `initialDelayMs?` | `number` | Initial delay in ms before first retry. **Default** `1000` | [builder/queue.ts:494](https://github.com/btravers/amqp-contract/blob/
|
|
566
|
-
| <a id="jitter"></a> `jitter?` | `boolean` | Add jitter to prevent thundering herd. **Default** `true` | [builder/queue.ts:512](https://github.com/btravers/amqp-contract/blob/
|
|
567
|
-
| <a id="maxdelayms"></a> `maxDelayMs?` | `number` | Maximum delay in ms between retries. **Default** `30000` | [builder/queue.ts:500](https://github.com/btravers/amqp-contract/blob/
|
|
568
|
-
| <a id="maxretries"></a> `maxRetries?` | `number` | Maximum retry attempts before sending to DLQ. **Default** `3` | [builder/queue.ts:488](https://github.com/btravers/amqp-contract/blob/
|
|
623
|
+
| <a id="arguments-2"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for advanced configuration. | [builder/queue.ts:523](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L523) |
|
|
624
|
+
| <a id="autodelete-2"></a> `autoDelete?` | `boolean` | If true, the queue is deleted when the last consumer unsubscribes. **Default** `false` | [builder/queue.ts:518](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L518) |
|
|
625
|
+
| <a id="backoffmultiplier"></a> `backoffMultiplier?` | `number` | Exponential backoff multiplier. **Default** `2` | [builder/queue.ts:506](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L506) |
|
|
626
|
+
| <a id="deadletter-1"></a> `deadLetter` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration - required for TTL-backoff retry. Used for routing messages to the wait queue and back. | [builder/queue.ts:482](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L482) |
|
|
627
|
+
| <a id="initialdelayms"></a> `initialDelayMs?` | `number` | Initial delay in ms before first retry. **Default** `1000` | [builder/queue.ts:494](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L494) |
|
|
628
|
+
| <a id="jitter"></a> `jitter?` | `boolean` | Add jitter to prevent thundering herd. **Default** `true` | [builder/queue.ts:512](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L512) |
|
|
629
|
+
| <a id="maxdelayms"></a> `maxDelayMs?` | `number` | Maximum delay in ms between retries. **Default** `30000` | [builder/queue.ts:500](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L500) |
|
|
630
|
+
| <a id="maxretries"></a> `maxRetries?` | `number` | Maximum retry attempts before sending to DLQ. **Default** `3` | [builder/queue.ts:488](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L488) |
|
|
569
631
|
|
|
570
632
|
***
|
|
571
633
|
|
|
@@ -575,7 +637,7 @@ This simplified helper enforces the required configuration for TTL-backoff retry
|
|
|
575
637
|
type DirectExchangeDefinition<TName> = BaseExchangeDefinition<TName> & object;
|
|
576
638
|
```
|
|
577
639
|
|
|
578
|
-
Defined in: [types.ts:439](https://github.com/btravers/amqp-contract/blob/
|
|
640
|
+
Defined in: [types.ts:439](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L439)
|
|
579
641
|
|
|
580
642
|
A direct exchange definition.
|
|
581
643
|
|
|
@@ -586,7 +648,7 @@ This is ideal for point-to-point messaging where each message should go to speci
|
|
|
586
648
|
|
|
587
649
|
| Name | Type | Defined in |
|
|
588
650
|
| ------ | ------ | ------ |
|
|
589
|
-
| `type` | `"direct"` | [types.ts:441](https://github.com/btravers/amqp-contract/blob/
|
|
651
|
+
| `type` | `"direct"` | [types.ts:441](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L441) |
|
|
590
652
|
|
|
591
653
|
#### Type Parameters
|
|
592
654
|
|
|
@@ -607,10 +669,10 @@ const tasksExchange: DirectExchangeDefinition = defineExchange('tasks', 'direct'
|
|
|
607
669
|
### EventConsumerResult
|
|
608
670
|
|
|
609
671
|
```ts
|
|
610
|
-
type EventConsumerResult<TMessage, TExchange, TQueue, TDlxExchange> = object;
|
|
672
|
+
type EventConsumerResult<TMessage, TExchange, TQueue, TDlxExchange, TExchangeBinding, TBridgeExchange> = object;
|
|
611
673
|
```
|
|
612
674
|
|
|
613
|
-
Defined in: [builder/event.ts:
|
|
675
|
+
Defined in: [builder/event.ts:56](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L56)
|
|
614
676
|
|
|
615
677
|
Result from defineEventConsumer.
|
|
616
678
|
|
|
@@ -626,17 +688,21 @@ will be automatically extracted.
|
|
|
626
688
|
| `TExchange` *extends* [`ExchangeDefinition`](#exchangedefinition) | [`ExchangeDefinition`](#exchangedefinition) | - |
|
|
627
689
|
| `TQueue` *extends* [`QueueDefinition`](#queuedefinition) | [`QueueDefinition`](#queuedefinition) | - |
|
|
628
690
|
| `TDlxExchange` *extends* [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | - |
|
|
691
|
+
| `TExchangeBinding` *extends* [`ExchangeBindingDefinition`](#exchangebindingdefinition) \| `undefined` | [`ExchangeBindingDefinition`](#exchangebindingdefinition) \| `undefined` | - |
|
|
692
|
+
| `TBridgeExchange` *extends* [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | - |
|
|
629
693
|
|
|
630
694
|
#### Properties
|
|
631
695
|
|
|
632
696
|
| Property | Type | Description | Defined in |
|
|
633
697
|
| ------ | ------ | ------ | ------ |
|
|
634
|
-
| <a id="__brand-
|
|
635
|
-
| <a id="binding-2"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | The binding connecting the queue to the exchange | [builder/event.ts:
|
|
636
|
-
| <a id="
|
|
637
|
-
| <a id="
|
|
638
|
-
| <a id="
|
|
639
|
-
| <a id="
|
|
698
|
+
| <a id="__brand-4"></a> `__brand` | `"EventConsumerResult"` | Discriminator to identify this as an event consumer result | [builder/event.ts:67](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L67) |
|
|
699
|
+
| <a id="binding-2"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | The binding connecting the queue to the exchange | [builder/event.ts:71](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L71) |
|
|
700
|
+
| <a id="bridgeexchange-2"></a> `bridgeExchange` | `TBridgeExchange` | The bridge (local domain) exchange when bridging, if configured | [builder/event.ts:81](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L81) |
|
|
701
|
+
| <a id="consumer-2"></a> `consumer` | [`ConsumerDefinition`](#consumerdefinition)<`TMessage`> | The consumer definition for processing messages | [builder/event.ts:69](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L69) |
|
|
702
|
+
| <a id="deadletterexchange-2"></a> `deadLetterExchange` | `TDlxExchange` | The dead letter exchange from the queue, if configured | [builder/event.ts:77](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L77) |
|
|
703
|
+
| <a id="exchange-3"></a> `exchange` | `TExchange` | The source exchange this consumer subscribes to | [builder/event.ts:73](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L73) |
|
|
704
|
+
| <a id="exchangebinding-2"></a> `exchangeBinding` | `TExchangeBinding` | The exchange-to-exchange binding when bridging, if configured | [builder/event.ts:79](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L79) |
|
|
705
|
+
| <a id="queue-3"></a> `queue` | `TQueue` | The queue this consumer reads from | [builder/event.ts:75](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L75) |
|
|
640
706
|
|
|
641
707
|
***
|
|
642
708
|
|
|
@@ -646,7 +712,7 @@ will be automatically extracted.
|
|
|
646
712
|
type EventConsumerResultBase = object;
|
|
647
713
|
```
|
|
648
714
|
|
|
649
|
-
Defined in: [types.ts:947](https://github.com/btravers/amqp-contract/blob/
|
|
715
|
+
Defined in: [types.ts:947](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L947)
|
|
650
716
|
|
|
651
717
|
Base type for event consumer result.
|
|
652
718
|
|
|
@@ -661,12 +727,14 @@ defineEventConsumer for creating event consumers
|
|
|
661
727
|
|
|
662
728
|
| Property | Type | Defined in |
|
|
663
729
|
| ------ | ------ | ------ |
|
|
664
|
-
| <a id="__brand-
|
|
665
|
-
| <a id="binding-3"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | [types.ts:950](https://github.com/btravers/amqp-contract/blob/
|
|
666
|
-
| <a id="
|
|
667
|
-
| <a id="
|
|
668
|
-
| <a id="
|
|
669
|
-
| <a id="
|
|
730
|
+
| <a id="__brand-5"></a> `__brand` | `"EventConsumerResult"` | [types.ts:948](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L948) |
|
|
731
|
+
| <a id="binding-3"></a> `binding` | [`QueueBindingDefinition`](#queuebindingdefinition) | [types.ts:950](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L950) |
|
|
732
|
+
| <a id="bridgeexchange-3"></a> `bridgeExchange` | [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | [types.ts:955](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L955) |
|
|
733
|
+
| <a id="consumer-3"></a> `consumer` | [`ConsumerDefinition`](#consumerdefinition) | [types.ts:949](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L949) |
|
|
734
|
+
| <a id="deadletterexchange-3"></a> `deadLetterExchange` | [`ExchangeDefinition`](#exchangedefinition) \| `undefined` | [types.ts:953](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L953) |
|
|
735
|
+
| <a id="exchange-4"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:951](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L951) |
|
|
736
|
+
| <a id="exchangebinding-3"></a> `exchangeBinding` | [`ExchangeBindingDefinition`](#exchangebindingdefinition) \| `undefined` | [types.ts:954](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L954) |
|
|
737
|
+
| <a id="queue-4"></a> `queue` | [`QueueDefinition`](#queuedefinition) | [types.ts:952](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L952) |
|
|
670
738
|
|
|
671
739
|
***
|
|
672
740
|
|
|
@@ -676,7 +744,7 @@ defineEventConsumer for creating event consumers
|
|
|
676
744
|
type EventPublisherConfig<TMessage, TExchange, TRoutingKey> = object;
|
|
677
745
|
```
|
|
678
746
|
|
|
679
|
-
Defined in: [builder/event.ts:
|
|
747
|
+
Defined in: [builder/event.ts:30](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L30)
|
|
680
748
|
|
|
681
749
|
Configuration for an event publisher.
|
|
682
750
|
|
|
@@ -696,11 +764,11 @@ publishers broadcast events and consumers subscribe to receive them.
|
|
|
696
764
|
|
|
697
765
|
| Property | Type | Description | Defined in |
|
|
698
766
|
| ------ | ------ | ------ | ------ |
|
|
699
|
-
| <a id="__brand-
|
|
700
|
-
| <a id="arguments-3"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments | [builder/event.ts:
|
|
701
|
-
| <a id="exchange-5"></a> `exchange` | `TExchange` | The exchange to publish to | [builder/event.ts:
|
|
702
|
-
| <a id="message-3"></a> `message` | `TMessage` | The message definition | [builder/event.ts:
|
|
703
|
-
| <a id="routingkey-3"></a> `routingKey` | `TRoutingKey` | The routing key for direct/topic exchanges | [builder/event.ts:
|
|
767
|
+
| <a id="__brand-6"></a> `__brand` | `"EventPublisherConfig"` | Discriminator to identify this as an event publisher config | [builder/event.ts:36](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L36) |
|
|
768
|
+
| <a id="arguments-3"></a> `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments | [builder/event.ts:44](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L44) |
|
|
769
|
+
| <a id="exchange-5"></a> `exchange` | `TExchange` | The exchange to publish to | [builder/event.ts:38](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L38) |
|
|
770
|
+
| <a id="message-3"></a> `message` | `TMessage` | The message definition | [builder/event.ts:40](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L40) |
|
|
771
|
+
| <a id="routingkey-3"></a> `routingKey` | `TRoutingKey` | The routing key for direct/topic exchanges | [builder/event.ts:42](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L42) |
|
|
704
772
|
|
|
705
773
|
***
|
|
706
774
|
|
|
@@ -710,7 +778,7 @@ publishers broadcast events and consumers subscribe to receive them.
|
|
|
710
778
|
type EventPublisherConfigBase = object;
|
|
711
779
|
```
|
|
712
780
|
|
|
713
|
-
Defined in: [types.ts:912](https://github.com/btravers/amqp-contract/blob/
|
|
781
|
+
Defined in: [types.ts:912](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L912)
|
|
714
782
|
|
|
715
783
|
Base type for event publisher configuration.
|
|
716
784
|
|
|
@@ -725,11 +793,11 @@ defineEventPublisher for creating event publishers
|
|
|
725
793
|
|
|
726
794
|
| Property | Type | Defined in |
|
|
727
795
|
| ------ | ------ | ------ |
|
|
728
|
-
| <a id="__brand-
|
|
729
|
-
| <a id="arguments-4"></a> `arguments?` | `Record`<`string`, `unknown`> | [types.ts:917](https://github.com/btravers/amqp-contract/blob/
|
|
730
|
-
| <a id="exchange-6"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:914](https://github.com/btravers/amqp-contract/blob/
|
|
731
|
-
| <a id="message-4"></a> `message` | [`MessageDefinition`](#messagedefinition) | [types.ts:915](https://github.com/btravers/amqp-contract/blob/
|
|
732
|
-
| <a id="routingkey-4"></a> `routingKey` | `string` \| `undefined` | [types.ts:916](https://github.com/btravers/amqp-contract/blob/
|
|
796
|
+
| <a id="__brand-7"></a> `__brand` | `"EventPublisherConfig"` | [types.ts:913](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L913) |
|
|
797
|
+
| <a id="arguments-4"></a> `arguments?` | `Record`<`string`, `unknown`> | [types.ts:917](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L917) |
|
|
798
|
+
| <a id="exchange-6"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | [types.ts:914](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L914) |
|
|
799
|
+
| <a id="message-4"></a> `message` | [`MessageDefinition`](#messagedefinition) | [types.ts:915](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L915) |
|
|
800
|
+
| <a id="routingkey-4"></a> `routingKey` | `string` \| `undefined` | [types.ts:916](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L916) |
|
|
733
801
|
|
|
734
802
|
***
|
|
735
803
|
|
|
@@ -748,7 +816,7 @@ type ExchangeBindingDefinition = object &
|
|
|
748
816
|
};
|
|
749
817
|
```
|
|
750
818
|
|
|
751
|
-
Defined in: [types.ts:795](https://github.com/btravers/amqp-contract/blob/
|
|
819
|
+
Defined in: [types.ts:795](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L795)
|
|
752
820
|
|
|
753
821
|
Binding between two exchanges (exchange-to-exchange routing).
|
|
754
822
|
|
|
@@ -759,9 +827,9 @@ This allows for more complex routing topologies.
|
|
|
759
827
|
|
|
760
828
|
| Name | Type | Description | Defined in |
|
|
761
829
|
| ------ | ------ | ------ | ------ |
|
|
762
|
-
| `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for the binding. | [types.ts:805](https://github.com/btravers/amqp-contract/blob/
|
|
763
|
-
| `destination` | [`ExchangeDefinition`](#exchangedefinition) | The destination exchange that will receive forwarded messages | [types.ts:800](https://github.com/btravers/amqp-contract/blob/
|
|
764
|
-
| `type` | `"exchange"` | Discriminator indicating this is an exchange-to-exchange binding | [types.ts:797](https://github.com/btravers/amqp-contract/blob/
|
|
830
|
+
| `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for the binding. | [types.ts:805](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L805) |
|
|
831
|
+
| `destination` | [`ExchangeDefinition`](#exchangedefinition) | The destination exchange that will receive forwarded messages | [types.ts:800](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L800) |
|
|
832
|
+
| `type` | `"exchange"` | Discriminator indicating this is an exchange-to-exchange binding | [types.ts:797](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L797) |
|
|
765
833
|
|
|
766
834
|
#### Example
|
|
767
835
|
|
|
@@ -786,7 +854,7 @@ type ExchangeDefinition<TName> =
|
|
|
786
854
|
| TopicExchangeDefinition<TName>;
|
|
787
855
|
```
|
|
788
856
|
|
|
789
|
-
Defined in: [types.ts:471](https://github.com/btravers/amqp-contract/blob/
|
|
857
|
+
Defined in: [types.ts:471](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L471)
|
|
790
858
|
|
|
791
859
|
Union type of all exchange definitions.
|
|
792
860
|
|
|
@@ -806,7 +874,7 @@ Represents any type of AMQP exchange: fanout, direct, or topic.
|
|
|
806
874
|
type FanoutExchangeDefinition<TName> = BaseExchangeDefinition<TName> & object;
|
|
807
875
|
```
|
|
808
876
|
|
|
809
|
-
Defined in: [types.ts:421](https://github.com/btravers/amqp-contract/blob/
|
|
877
|
+
Defined in: [types.ts:421](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L421)
|
|
810
878
|
|
|
811
879
|
A fanout exchange definition.
|
|
812
880
|
|
|
@@ -817,7 +885,7 @@ This is the simplest exchange type for pub/sub messaging patterns.
|
|
|
817
885
|
|
|
818
886
|
| Name | Type | Defined in |
|
|
819
887
|
| ------ | ------ | ------ |
|
|
820
|
-
| `type` | `"fanout"` | [types.ts:423](https://github.com/btravers/amqp-contract/blob/
|
|
888
|
+
| `type` | `"fanout"` | [types.ts:423](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L423) |
|
|
821
889
|
|
|
822
890
|
#### Type Parameters
|
|
823
891
|
|
|
@@ -841,7 +909,7 @@ const logsExchange: FanoutExchangeDefinition = defineExchange('logs', 'fanout',
|
|
|
841
909
|
type InferConsumerNames<TContract> = TContract["consumers"] extends Record<string, unknown> ? keyof TContract["consumers"] : never;
|
|
842
910
|
```
|
|
843
911
|
|
|
844
|
-
Defined in: [types.ts:
|
|
912
|
+
Defined in: [types.ts:1489](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1489)
|
|
845
913
|
|
|
846
914
|
Extract consumer names from a contract.
|
|
847
915
|
|
|
@@ -873,7 +941,7 @@ type ConsumerNames = InferConsumerNames<typeof myContract>;
|
|
|
873
941
|
type InferPublisherNames<TContract> = TContract["publishers"] extends Record<string, unknown> ? keyof TContract["publishers"] : never;
|
|
874
942
|
```
|
|
875
943
|
|
|
876
|
-
Defined in: [types.ts:
|
|
944
|
+
Defined in: [types.ts:1471](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1471)
|
|
877
945
|
|
|
878
946
|
Extract publisher names from a contract.
|
|
879
947
|
|
|
@@ -905,7 +973,7 @@ type PublisherNames = InferPublisherNames<typeof myContract>;
|
|
|
905
973
|
type MatchingRoutingKey<Pattern, Key> = RoutingKey<Key> extends never ? never : BindingPattern<Pattern> extends never ? never : MatchesPattern<Key, Pattern> extends true ? Key : never;
|
|
906
974
|
```
|
|
907
975
|
|
|
908
|
-
Defined in: [builder/routing-types.ts:114](https://github.com/btravers/amqp-contract/blob/
|
|
976
|
+
Defined in: [builder/routing-types.ts:114](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/routing-types.ts#L114)
|
|
909
977
|
|
|
910
978
|
Validate that a routing key matches a binding pattern.
|
|
911
979
|
|
|
@@ -937,7 +1005,7 @@ type InvalidKey = MatchingRoutingKey<"order.*", "user.created">; // never
|
|
|
937
1005
|
type MessageDefinition<TPayload, THeaders> = object;
|
|
938
1006
|
```
|
|
939
1007
|
|
|
940
|
-
Defined in: [types.ts:711](https://github.com/btravers/amqp-contract/blob/
|
|
1008
|
+
Defined in: [types.ts:711](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L711)
|
|
941
1009
|
|
|
942
1010
|
Definition of a message with typed payload and optional headers.
|
|
943
1011
|
|
|
@@ -952,10 +1020,10 @@ Definition of a message with typed payload and optional headers.
|
|
|
952
1020
|
|
|
953
1021
|
| Property | Type | Description | Defined in |
|
|
954
1022
|
| ------ | ------ | ------ | ------ |
|
|
955
|
-
| <a id="description"></a> `description?` | `string` | Detailed description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:737](https://github.com/btravers/amqp-contract/blob/
|
|
956
|
-
| <a id="headers"></a> `headers?` | `THeaders` | Optional headers schema for validating message metadata. Must be a Standard Schema v1 compatible schema. | [types.ts:725](https://github.com/btravers/amqp-contract/blob/
|
|
957
|
-
| <a id="payload"></a> `payload` | `TPayload` | The payload schema for validating message content. Must be a Standard Schema v1 compatible schema (Zod, Valibot, ArkType, etc.). | [types.ts:719](https://github.com/btravers/amqp-contract/blob/
|
|
958
|
-
| <a id="summary"></a> `summary?` | `string` | Brief description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:731](https://github.com/btravers/amqp-contract/blob/
|
|
1023
|
+
| <a id="description"></a> `description?` | `string` | Detailed description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:737](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L737) |
|
|
1024
|
+
| <a id="headers"></a> `headers?` | `THeaders` | Optional headers schema for validating message metadata. Must be a Standard Schema v1 compatible schema. | [types.ts:725](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L725) |
|
|
1025
|
+
| <a id="payload"></a> `payload` | `TPayload` | The payload schema for validating message content. Must be a Standard Schema v1 compatible schema (Zod, Valibot, ArkType, etc.). | [types.ts:719](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L719) |
|
|
1026
|
+
| <a id="summary"></a> `summary?` | `string` | Brief description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:731](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L731) |
|
|
959
1027
|
|
|
960
1028
|
***
|
|
961
1029
|
|
|
@@ -974,7 +1042,7 @@ type PublisherDefinition<TMessage> = object &
|
|
|
974
1042
|
};
|
|
975
1043
|
```
|
|
976
1044
|
|
|
977
|
-
Defined in: [types.ts:853](https://github.com/btravers/amqp-contract/blob/
|
|
1045
|
+
Defined in: [types.ts:853](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L853)
|
|
978
1046
|
|
|
979
1047
|
Definition of a message publisher.
|
|
980
1048
|
|
|
@@ -988,7 +1056,7 @@ algorithm when calling the publish method.
|
|
|
988
1056
|
|
|
989
1057
|
| Name | Type | Description | Defined in |
|
|
990
1058
|
| ------ | ------ | ------ | ------ |
|
|
991
|
-
| `message` | `TMessage` | The message definition including the payload schema | [types.ts:855](https://github.com/btravers/amqp-contract/blob/
|
|
1059
|
+
| `message` | `TMessage` | The message definition including the payload schema | [types.ts:855](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L855) |
|
|
992
1060
|
|
|
993
1061
|
#### Type Parameters
|
|
994
1062
|
|
|
@@ -1013,10 +1081,11 @@ const publisher: PublisherDefinition = {
|
|
|
1013
1081
|
```ts
|
|
1014
1082
|
type PublisherEntry =
|
|
1015
1083
|
| PublisherDefinition
|
|
1016
|
-
| EventPublisherConfigBase
|
|
1084
|
+
| EventPublisherConfigBase
|
|
1085
|
+
| BridgedPublisherConfigBase;
|
|
1017
1086
|
```
|
|
1018
1087
|
|
|
1019
|
-
Defined in: [types.ts:
|
|
1088
|
+
Defined in: [types.ts:1051](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L1051)
|
|
1020
1089
|
|
|
1021
1090
|
Publisher entry that can be passed to defineContract's publishers section.
|
|
1022
1091
|
|
|
@@ -1041,7 +1110,7 @@ type QueueBindingDefinition = object &
|
|
|
1041
1110
|
};
|
|
1042
1111
|
```
|
|
1043
1112
|
|
|
1044
|
-
Defined in: [types.ts:747](https://github.com/btravers/amqp-contract/blob/
|
|
1113
|
+
Defined in: [types.ts:747](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L747)
|
|
1045
1114
|
|
|
1046
1115
|
Binding between a queue and an exchange.
|
|
1047
1116
|
|
|
@@ -1053,9 +1122,9 @@ For fanout exchanges, no routing key is needed as all messages are broadcast.
|
|
|
1053
1122
|
|
|
1054
1123
|
| Name | Type | Description | Defined in |
|
|
1055
1124
|
| ------ | ------ | ------ | ------ |
|
|
1056
|
-
| `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for the binding. Can be used for advanced routing scenarios with the headers exchange type. | [types.ts:758](https://github.com/btravers/amqp-contract/blob/
|
|
1057
|
-
| `queue` | [`QueueDefinition`](#queuedefinition) | The queue that will receive messages | [types.ts:752](https://github.com/btravers/amqp-contract/blob/
|
|
1058
|
-
| `type` | `"queue"` | Discriminator indicating this is a queue-to-exchange binding | [types.ts:749](https://github.com/btravers/amqp-contract/blob/
|
|
1125
|
+
| `arguments?` | `Record`<`string`, `unknown`> | Additional AMQP arguments for the binding. Can be used for advanced routing scenarios with the headers exchange type. | [types.ts:758](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L758) |
|
|
1126
|
+
| `queue` | [`QueueDefinition`](#queuedefinition) | The queue that will receive messages | [types.ts:752](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L752) |
|
|
1127
|
+
| `type` | `"queue"` | Discriminator indicating this is a queue-to-exchange binding | [types.ts:749](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L749) |
|
|
1059
1128
|
|
|
1060
1129
|
***
|
|
1061
1130
|
|
|
@@ -1067,7 +1136,7 @@ type QueueDefinition<TName> =
|
|
|
1067
1136
|
| ClassicQueueDefinition<TName>;
|
|
1068
1137
|
```
|
|
1069
1138
|
|
|
1070
|
-
Defined in: [types.ts:632](https://github.com/btravers/amqp-contract/blob/
|
|
1139
|
+
Defined in: [types.ts:632](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L632)
|
|
1071
1140
|
|
|
1072
1141
|
Definition of an AMQP queue.
|
|
1073
1142
|
|
|
@@ -1093,7 +1162,7 @@ type QueueEntry<TName> =
|
|
|
1093
1162
|
| QueueWithTtlBackoffInfrastructure<TName>;
|
|
1094
1163
|
```
|
|
1095
1164
|
|
|
1096
|
-
Defined in: [types.ts:701](https://github.com/btravers/amqp-contract/blob/
|
|
1165
|
+
Defined in: [types.ts:701](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L701)
|
|
1097
1166
|
|
|
1098
1167
|
A queue entry that can be passed to `defineContract`.
|
|
1099
1168
|
|
|
@@ -1113,7 +1182,7 @@ Can be either a plain queue definition or a queue with TTL-backoff infrastructur
|
|
|
1113
1182
|
type QueueType = "quorum" | "classic";
|
|
1114
1183
|
```
|
|
1115
1184
|
|
|
1116
|
-
Defined in: [types.ts:163](https://github.com/btravers/amqp-contract/blob/
|
|
1185
|
+
Defined in: [types.ts:163](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L163)
|
|
1117
1186
|
|
|
1118
1187
|
Supported queue types in RabbitMQ.
|
|
1119
1188
|
|
|
@@ -1152,7 +1221,7 @@ const tempQueue = defineQueue('temp-queue', {
|
|
|
1152
1221
|
type QueueWithTtlBackoffInfrastructure<TName> = object;
|
|
1153
1222
|
```
|
|
1154
1223
|
|
|
1155
|
-
Defined in: [types.ts:662](https://github.com/btravers/amqp-contract/blob/
|
|
1224
|
+
Defined in: [types.ts:662](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L662)
|
|
1156
1225
|
|
|
1157
1226
|
A queue with automatically generated TTL-backoff retry infrastructure.
|
|
1158
1227
|
|
|
@@ -1190,11 +1259,11 @@ const contract = defineContract({
|
|
|
1190
1259
|
|
|
1191
1260
|
| Property | Type | Description | Defined in |
|
|
1192
1261
|
| ------ | ------ | ------ | ------ |
|
|
1193
|
-
| <a id="deadletter-2"></a> `deadLetter` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration from the main queue. Always present since TTL-backoff infrastructure requires a dead letter exchange. | [types.ts:678](https://github.com/btravers/amqp-contract/blob/
|
|
1194
|
-
| <a id="mainqueueretrybinding"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [types.ts:693](https://github.com/btravers/amqp-contract/blob/
|
|
1195
|
-
| <a id="queue-5"></a> `queue` | [`QueueDefinition`](#queuedefinition)<`TName`> | The main queue definition. | [types.ts:672](https://github.com/btravers/amqp-contract/blob/
|
|
1196
|
-
| <a id="waitqueue"></a> `waitQueue` | [`QueueDefinition`](#queuedefinition) | The wait queue for holding messages during backoff delay. | [types.ts:683](https://github.com/btravers/amqp-contract/blob/
|
|
1197
|
-
| <a id="waitqueuebinding"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [types.ts:688](https://github.com/btravers/amqp-contract/blob/
|
|
1262
|
+
| <a id="deadletter-2"></a> `deadLetter` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration from the main queue. Always present since TTL-backoff infrastructure requires a dead letter exchange. | [types.ts:678](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L678) |
|
|
1263
|
+
| <a id="mainqueueretrybinding"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [types.ts:693](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L693) |
|
|
1264
|
+
| <a id="queue-5"></a> `queue` | [`QueueDefinition`](#queuedefinition)<`TName`> | The main queue definition. | [types.ts:672](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L672) |
|
|
1265
|
+
| <a id="waitqueue"></a> `waitQueue` | [`QueueDefinition`](#queuedefinition) | The wait queue for holding messages during backoff delay. | [types.ts:683](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L683) |
|
|
1266
|
+
| <a id="waitqueuebinding"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [types.ts:688](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L688) |
|
|
1198
1267
|
|
|
1199
1268
|
***
|
|
1200
1269
|
|
|
@@ -1204,7 +1273,7 @@ const contract = defineContract({
|
|
|
1204
1273
|
type QuorumNativeRetryOptions = object;
|
|
1205
1274
|
```
|
|
1206
1275
|
|
|
1207
|
-
Defined in: [types.ts:72](https://github.com/btravers/amqp-contract/blob/
|
|
1276
|
+
Defined in: [types.ts:72](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L72)
|
|
1208
1277
|
|
|
1209
1278
|
Quorum-Native retry options using RabbitMQ's native delivery limit feature.
|
|
1210
1279
|
|
|
@@ -1224,7 +1293,7 @@ https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling
|
|
|
1224
1293
|
|
|
1225
1294
|
| Property | Type | Description | Defined in |
|
|
1226
1295
|
| ------ | ------ | ------ | ------ |
|
|
1227
|
-
| <a id="mode"></a> `mode` | `"quorum-native"` | Quorum-Native mode uses RabbitMQ's native delivery limit feature. Requires the queue to be a quorum queue with `deliveryLimit` configured. | [types.ts:77](https://github.com/btravers/amqp-contract/blob/
|
|
1296
|
+
| <a id="mode"></a> `mode` | `"quorum-native"` | Quorum-Native mode uses RabbitMQ's native delivery limit feature. Requires the queue to be a quorum queue with `deliveryLimit` configured. | [types.ts:77](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L77) |
|
|
1228
1297
|
|
|
1229
1298
|
***
|
|
1230
1299
|
|
|
@@ -1234,7 +1303,7 @@ https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling
|
|
|
1234
1303
|
type QuorumQueueDefinition<TName> = BaseQueueDefinition<TName> & object;
|
|
1235
1304
|
```
|
|
1236
1305
|
|
|
1237
|
-
Defined in: [types.ts:545](https://github.com/btravers/amqp-contract/blob/
|
|
1306
|
+
Defined in: [types.ts:545](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L545)
|
|
1238
1307
|
|
|
1239
1308
|
Definition of a quorum queue.
|
|
1240
1309
|
|
|
@@ -1245,11 +1314,11 @@ They support native retry handling via `deliveryLimit` and both TTL-backoff and
|
|
|
1245
1314
|
|
|
1246
1315
|
| Name | Type | Description | Defined in |
|
|
1247
1316
|
| ------ | ------ | ------ | ------ |
|
|
1248
|
-
| `deliveryLimit?` | `number` | Maximum number of delivery attempts before the message is dead-lettered. This is a quorum queue-specific feature. When a message is rejected (nacked) and requeued, RabbitMQ increments the `x-delivery-count` header. When this count reaches the delivery limit, the message is automatically dead-lettered (if DLX is configured) or dropped. **Minimum** 1 - Must be a positive integer (1 or greater) **See** https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling | [types.ts:575](https://github.com/btravers/amqp-contract/blob/
|
|
1249
|
-
| `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:555](https://github.com/btravers/amqp-contract/blob/
|
|
1250
|
-
| `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:561](https://github.com/btravers/amqp-contract/blob/
|
|
1251
|
-
| `retry` | [`ResolvedRetryOptions`](#resolvedretryoptions) | Retry configuration for handling failed message processing. Quorum queues support both: - `ttl-backoff`: Uses wait queues with exponential backoff (default) - `quorum-native`: Uses RabbitMQ's native delivery limit feature When the queue is created, defaults are applied for TTL-backoff options. | [types.ts:586](https://github.com/btravers/amqp-contract/blob/
|
|
1252
|
-
| `type` | `"quorum"` | Queue type discriminator: quorum queue. | [types.ts:549](https://github.com/btravers/amqp-contract/blob/
|
|
1317
|
+
| `deliveryLimit?` | `number` | Maximum number of delivery attempts before the message is dead-lettered. This is a quorum queue-specific feature. When a message is rejected (nacked) and requeued, RabbitMQ increments the `x-delivery-count` header. When this count reaches the delivery limit, the message is automatically dead-lettered (if DLX is configured) or dropped. **Minimum** 1 - Must be a positive integer (1 or greater) **See** https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling | [types.ts:575](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L575) |
|
|
1318
|
+
| `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:555](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L555) |
|
|
1319
|
+
| `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:561](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L561) |
|
|
1320
|
+
| `retry` | [`ResolvedRetryOptions`](#resolvedretryoptions) | Retry configuration for handling failed message processing. Quorum queues support both: - `ttl-backoff`: Uses wait queues with exponential backoff (default) - `quorum-native`: Uses RabbitMQ's native delivery limit feature When the queue is created, defaults are applied for TTL-backoff options. | [types.ts:586](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L586) |
|
|
1321
|
+
| `type` | `"quorum"` | Queue type discriminator: quorum queue. | [types.ts:549](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L549) |
|
|
1253
1322
|
|
|
1254
1323
|
#### Type Parameters
|
|
1255
1324
|
|
|
@@ -1265,7 +1334,7 @@ They support native retry handling via `deliveryLimit` and both TTL-backoff and
|
|
|
1265
1334
|
type QuorumQueueOptions = BaseQueueOptions & object;
|
|
1266
1335
|
```
|
|
1267
1336
|
|
|
1268
|
-
Defined in: [types.ts:214](https://github.com/btravers/amqp-contract/blob/
|
|
1337
|
+
Defined in: [types.ts:214](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L214)
|
|
1269
1338
|
|
|
1270
1339
|
Options for creating a quorum queue.
|
|
1271
1340
|
|
|
@@ -1282,11 +1351,11 @@ Quorum queues provide native retry support via `deliveryLimit`:
|
|
|
1282
1351
|
|
|
1283
1352
|
| Name | Type | Description | Defined in |
|
|
1284
1353
|
| ------ | ------ | ------ | ------ |
|
|
1285
|
-
| `deliveryLimit?` | `number` | Maximum number of delivery attempts before the message is dead-lettered. When a message is rejected (nacked) and requeued, RabbitMQ increments the `x-delivery-count` header. When this count reaches the delivery limit, the message is automatically dead-lettered (if DLX is configured) or dropped. This is a quorum queue-specific feature that provides native retry handling without the complexity of TTL-based wait queues. **Benefits over TTL-based retry:** - Simpler architecture (no wait queues needed) - No head-of-queue blocking issues (TTL only works at queue head) - Native RabbitMQ feature with atomic guarantees **Minimum** 1 - Must be a positive integer (1 or greater) **See** https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling **Example** `const orderQueue = defineQueue('order-processing', { type: 'quorum', deliveryLimit: 5, // Allow up to 5 delivery attempts deadLetter: { exchange: dlx, routingKey: 'order.failed', }, });` | [types.ts:263](https://github.com/btravers/amqp-contract/blob/
|
|
1286
|
-
| `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:224](https://github.com/btravers/amqp-contract/blob/
|
|
1287
|
-
| `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:230](https://github.com/btravers/amqp-contract/blob/
|
|
1288
|
-
| `retry?` | \| [`TtlBackoffRetryOptions`](#ttlbackoffretryoptions) \| [`QuorumNativeRetryOptions`](#quorumnativeretryoptions) | Retry configuration for handling failed message processing. Determines how the worker handles retries for consumers using this queue: - `"ttl-backoff"` (default): Uses wait queues with exponential backoff - `"quorum-native"`: Uses RabbitMQ's native delivery limit feature When using `"ttl-backoff"` mode, the core package will automatically create a wait queue (`{queueName}-wait`) and the necessary bindings. **Example** `// TTL-backoff mode with custom options const orderQueue = defineQueue('order-processing', { type: 'quorum', deadLetter: { exchange: dlx }, retry: { mode: 'ttl-backoff', maxRetries: 5, initialDelayMs: 1000, maxDelayMs: 30000, }, }); // Quorum-native mode const orderQueue = defineQueue('order-processing', { type: 'quorum', deliveryLimit: 5, deadLetter: { exchange: dlx }, retry: { mode: 'quorum-native' }, });` | [types.ts:298](https://github.com/btravers/amqp-contract/blob/
|
|
1289
|
-
| `type?` | `"quorum"` | Queue type: quorum (default, recommended) | [types.ts:218](https://github.com/btravers/amqp-contract/blob/
|
|
1354
|
+
| `deliveryLimit?` | `number` | Maximum number of delivery attempts before the message is dead-lettered. When a message is rejected (nacked) and requeued, RabbitMQ increments the `x-delivery-count` header. When this count reaches the delivery limit, the message is automatically dead-lettered (if DLX is configured) or dropped. This is a quorum queue-specific feature that provides native retry handling without the complexity of TTL-based wait queues. **Benefits over TTL-based retry:** - Simpler architecture (no wait queues needed) - No head-of-queue blocking issues (TTL only works at queue head) - Native RabbitMQ feature with atomic guarantees **Minimum** 1 - Must be a positive integer (1 or greater) **See** https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling **Example** `const orderQueue = defineQueue('order-processing', { type: 'quorum', deliveryLimit: 5, // Allow up to 5 delivery attempts deadLetter: { exchange: dlx, routingKey: 'order.failed', }, });` | [types.ts:263](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L263) |
|
|
1355
|
+
| `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:224](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L224) |
|
|
1356
|
+
| `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:230](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L230) |
|
|
1357
|
+
| `retry?` | \| [`TtlBackoffRetryOptions`](#ttlbackoffretryoptions) \| [`QuorumNativeRetryOptions`](#quorumnativeretryoptions) | Retry configuration for handling failed message processing. Determines how the worker handles retries for consumers using this queue: - `"ttl-backoff"` (default): Uses wait queues with exponential backoff - `"quorum-native"`: Uses RabbitMQ's native delivery limit feature When using `"ttl-backoff"` mode, the core package will automatically create a wait queue (`{queueName}-wait`) and the necessary bindings. **Example** `// TTL-backoff mode with custom options const orderQueue = defineQueue('order-processing', { type: 'quorum', deadLetter: { exchange: dlx }, retry: { mode: 'ttl-backoff', maxRetries: 5, initialDelayMs: 1000, maxDelayMs: 30000, }, }); // Quorum-native mode const orderQueue = defineQueue('order-processing', { type: 'quorum', deliveryLimit: 5, deadLetter: { exchange: dlx }, retry: { mode: 'quorum-native' }, });` | [types.ts:298](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L298) |
|
|
1358
|
+
| `type?` | `"quorum"` | Queue type: quorum (default, recommended) | [types.ts:218](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L218) |
|
|
1290
1359
|
|
|
1291
1360
|
#### Example
|
|
1292
1361
|
|
|
@@ -1308,7 +1377,7 @@ type ResolvedRetryOptions =
|
|
|
1308
1377
|
| QuorumNativeRetryOptions;
|
|
1309
1378
|
```
|
|
1310
1379
|
|
|
1311
|
-
Defined in: [types.ts:104](https://github.com/btravers/amqp-contract/blob/
|
|
1380
|
+
Defined in: [types.ts:104](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L104)
|
|
1312
1381
|
|
|
1313
1382
|
Resolved retry configuration stored in queue definitions.
|
|
1314
1383
|
|
|
@@ -1324,7 +1393,7 @@ This is a discriminated union based on the `mode` field:
|
|
|
1324
1393
|
type RoutingKey<S> = S extends "" ? never : S extends `${string}*${string}` | `${string}#${string}` ? never : S;
|
|
1325
1394
|
```
|
|
1326
1395
|
|
|
1327
|
-
Defined in: [builder/routing-types.ts:25](https://github.com/btravers/amqp-contract/blob/
|
|
1396
|
+
Defined in: [builder/routing-types.ts:25](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/routing-types.ts#L25)
|
|
1328
1397
|
|
|
1329
1398
|
Type-safe routing key that validates basic format.
|
|
1330
1399
|
|
|
@@ -1358,7 +1427,7 @@ type Invalid2 = RoutingKey<"">; // never (empty string)
|
|
|
1358
1427
|
type TopicExchangeDefinition<TName> = BaseExchangeDefinition<TName> & object;
|
|
1359
1428
|
```
|
|
1360
1429
|
|
|
1361
|
-
Defined in: [types.ts:461](https://github.com/btravers/amqp-contract/blob/
|
|
1430
|
+
Defined in: [types.ts:461](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L461)
|
|
1362
1431
|
|
|
1363
1432
|
A topic exchange definition.
|
|
1364
1433
|
|
|
@@ -1372,7 +1441,7 @@ Words are separated by dots (e.g., `order.created.high-value`).
|
|
|
1372
1441
|
|
|
1373
1442
|
| Name | Type | Defined in |
|
|
1374
1443
|
| ------ | ------ | ------ |
|
|
1375
|
-
| `type` | `"topic"` | [types.ts:463](https://github.com/btravers/amqp-contract/blob/
|
|
1444
|
+
| `type` | `"topic"` | [types.ts:463](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L463) |
|
|
1376
1445
|
|
|
1377
1446
|
#### Type Parameters
|
|
1378
1447
|
|
|
@@ -1397,7 +1466,7 @@ const ordersExchange: TopicExchangeDefinition = defineExchange('orders', 'topic'
|
|
|
1397
1466
|
type TtlBackoffRetryInfrastructure = object;
|
|
1398
1467
|
```
|
|
1399
1468
|
|
|
1400
|
-
Defined in: [builder/ttl-backoff.ts:10](https://github.com/btravers/amqp-contract/blob/
|
|
1469
|
+
Defined in: [builder/ttl-backoff.ts:10](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/ttl-backoff.ts#L10)
|
|
1401
1470
|
|
|
1402
1471
|
Result type for TTL-backoff retry infrastructure builder.
|
|
1403
1472
|
|
|
@@ -1407,9 +1476,9 @@ Contains the wait queue and bindings needed for TTL-backoff retry.
|
|
|
1407
1476
|
|
|
1408
1477
|
| Property | Type | Description | Defined in |
|
|
1409
1478
|
| ------ | ------ | ------ | ------ |
|
|
1410
|
-
| <a id="mainqueueretrybinding-1"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [builder/ttl-backoff.ts:23](https://github.com/btravers/amqp-contract/blob/
|
|
1411
|
-
| <a id="waitqueue-1"></a> `waitQueue` | [`QueueDefinition`](#queuedefinition) | The wait queue for holding messages during backoff delay. This is a classic queue with a dead letter exchange pointing back to the main queue. | [builder/ttl-backoff.ts:15](https://github.com/btravers/amqp-contract/blob/
|
|
1412
|
-
| <a id="waitqueuebinding-1"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [builder/ttl-backoff.ts:19](https://github.com/btravers/amqp-contract/blob/
|
|
1479
|
+
| <a id="mainqueueretrybinding-1"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [builder/ttl-backoff.ts:23](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/ttl-backoff.ts#L23) |
|
|
1480
|
+
| <a id="waitqueue-1"></a> `waitQueue` | [`QueueDefinition`](#queuedefinition) | The wait queue for holding messages during backoff delay. This is a classic queue with a dead letter exchange pointing back to the main queue. | [builder/ttl-backoff.ts:15](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/ttl-backoff.ts#L15) |
|
|
1481
|
+
| <a id="waitqueuebinding-1"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [builder/ttl-backoff.ts:19](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/ttl-backoff.ts#L19) |
|
|
1413
1482
|
|
|
1414
1483
|
***
|
|
1415
1484
|
|
|
@@ -1419,7 +1488,7 @@ Contains the wait queue and bindings needed for TTL-backoff retry.
|
|
|
1419
1488
|
type TtlBackoffRetryOptions = object;
|
|
1420
1489
|
```
|
|
1421
1490
|
|
|
1422
|
-
Defined in: [types.ts:27](https://github.com/btravers/amqp-contract/blob/
|
|
1491
|
+
Defined in: [types.ts:27](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L27)
|
|
1423
1492
|
|
|
1424
1493
|
TTL-Backoff retry options for exponential backoff with configurable delays.
|
|
1425
1494
|
|
|
@@ -1433,12 +1502,12 @@ per-message TTL, then dead-lettered back to the main queue after the TTL expires
|
|
|
1433
1502
|
|
|
1434
1503
|
| Property | Type | Description | Defined in |
|
|
1435
1504
|
| ------ | ------ | ------ | ------ |
|
|
1436
|
-
| <a id="backoffmultiplier-1"></a> `backoffMultiplier?` | `number` | Exponential backoff multiplier. **Default** `2` | [types.ts:51](https://github.com/btravers/amqp-contract/blob/
|
|
1437
|
-
| <a id="initialdelayms-1"></a> `initialDelayMs?` | `number` | Initial delay in ms before first retry. **Default** `1000` | [types.ts:41](https://github.com/btravers/amqp-contract/blob/
|
|
1438
|
-
| <a id="jitter-1"></a> `jitter?` | `boolean` | Add jitter to prevent thundering herd. **Default** `true` | [types.ts:56](https://github.com/btravers/amqp-contract/blob/
|
|
1439
|
-
| <a id="maxdelayms-1"></a> `maxDelayMs?` | `number` | Maximum delay in ms between retries. **Default** `30000` | [types.ts:46](https://github.com/btravers/amqp-contract/blob/
|
|
1440
|
-
| <a id="maxretries-1"></a> `maxRetries?` | `number` | Maximum retry attempts before sending to DLQ. **Default** `3` | [types.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
1441
|
-
| <a id="mode-1"></a> `mode` | `"ttl-backoff"` | TTL-Backoff mode uses wait queues with per-message TTL for exponential backoff. | [types.ts:31](https://github.com/btravers/amqp-contract/blob/
|
|
1505
|
+
| <a id="backoffmultiplier-1"></a> `backoffMultiplier?` | `number` | Exponential backoff multiplier. **Default** `2` | [types.ts:51](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L51) |
|
|
1506
|
+
| <a id="initialdelayms-1"></a> `initialDelayMs?` | `number` | Initial delay in ms before first retry. **Default** `1000` | [types.ts:41](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L41) |
|
|
1507
|
+
| <a id="jitter-1"></a> `jitter?` | `boolean` | Add jitter to prevent thundering herd. **Default** `true` | [types.ts:56](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L56) |
|
|
1508
|
+
| <a id="maxdelayms-1"></a> `maxDelayMs?` | `number` | Maximum delay in ms between retries. **Default** `30000` | [types.ts:46](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L46) |
|
|
1509
|
+
| <a id="maxretries-1"></a> `maxRetries?` | `number` | Maximum retry attempts before sending to DLQ. **Default** `3` | [types.ts:36](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L36) |
|
|
1510
|
+
| <a id="mode-1"></a> `mode` | `"ttl-backoff"` | TTL-Backoff mode uses wait queues with per-message TTL for exponential backoff. | [types.ts:31](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/types.ts#L31) |
|
|
1442
1511
|
|
|
1443
1512
|
## Functions
|
|
1444
1513
|
|
|
@@ -1451,7 +1520,7 @@ function defineConsumer<TMessage>(
|
|
|
1451
1520
|
options?): ConsumerDefinition<TMessage>;
|
|
1452
1521
|
```
|
|
1453
1522
|
|
|
1454
|
-
Defined in: [builder/consumer.ts:121](https://github.com/btravers/amqp-contract/blob/
|
|
1523
|
+
Defined in: [builder/consumer.ts:121](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/consumer.ts#L121)
|
|
1455
1524
|
|
|
1456
1525
|
Define a message consumer.
|
|
1457
1526
|
|
|
@@ -1536,7 +1605,7 @@ const processOrderConsumer = defineConsumer(orderQueue, orderMessage);
|
|
|
1536
1605
|
function defineContract<TContract>(definition): ContractOutput<TContract>;
|
|
1537
1606
|
```
|
|
1538
1607
|
|
|
1539
|
-
Defined in: [builder/contract.ts:84](https://github.com/btravers/amqp-contract/blob/
|
|
1608
|
+
Defined in: [builder/contract.ts:84](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/contract.ts#L84)
|
|
1540
1609
|
|
|
1541
1610
|
Define an AMQP contract.
|
|
1542
1611
|
|
|
@@ -1625,7 +1694,7 @@ export const contract = defineContract({
|
|
|
1625
1694
|
function defineMessage<TPayload, THeaders>(payload, options?): MessageDefinition<TPayload, THeaders>;
|
|
1626
1695
|
```
|
|
1627
1696
|
|
|
1628
|
-
Defined in: [builder/message.ts:39](https://github.com/btravers/amqp-contract/blob/
|
|
1697
|
+
Defined in: [builder/message.ts:39](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/message.ts#L39)
|
|
1629
1698
|
|
|
1630
1699
|
Define a message definition with payload and optional headers/metadata.
|
|
1631
1700
|
|
|
@@ -1688,7 +1757,7 @@ const orderMessage = defineMessage(
|
|
|
1688
1757
|
function defineQueue<TName, TDlx>(name, options): QueueDefinition<TName> | QueueWithTtlBackoffInfrastructure<TName> & object;
|
|
1689
1758
|
```
|
|
1690
1759
|
|
|
1691
|
-
Defined in: [builder/queue.ts:246](https://github.com/btravers/amqp-contract/blob/
|
|
1760
|
+
Defined in: [builder/queue.ts:246](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L246)
|
|
1692
1761
|
|
|
1693
1762
|
Define an AMQP queue.
|
|
1694
1763
|
|
|
@@ -1769,7 +1838,7 @@ function defineQueue<TName>(name, options?):
|
|
|
1769
1838
|
| QueueWithTtlBackoffInfrastructure<TName>;
|
|
1770
1839
|
```
|
|
1771
1840
|
|
|
1772
|
-
Defined in: [builder/queue.ts:253](https://github.com/btravers/amqp-contract/blob/
|
|
1841
|
+
Defined in: [builder/queue.ts:253](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L253)
|
|
1773
1842
|
|
|
1774
1843
|
Define an AMQP queue.
|
|
1775
1844
|
|
|
@@ -1850,7 +1919,7 @@ const orderQueue = defineQueue('order-processing', {
|
|
|
1850
1919
|
function defineQuorumQueue<TName>(name, options): QuorumQueueDefinition<TName>;
|
|
1851
1920
|
```
|
|
1852
1921
|
|
|
1853
|
-
Defined in: [builder/queue.ts:451](https://github.com/btravers/amqp-contract/blob/
|
|
1922
|
+
Defined in: [builder/queue.ts:451](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L451)
|
|
1854
1923
|
|
|
1855
1924
|
Create a quorum queue with quorum-native retry.
|
|
1856
1925
|
|
|
@@ -1913,7 +1982,7 @@ const contract = defineContract({
|
|
|
1913
1982
|
function defineTtlBackoffQueue<TName>(name, options): QueueWithTtlBackoffInfrastructure<TName>;
|
|
1914
1983
|
```
|
|
1915
1984
|
|
|
1916
|
-
Defined in: [builder/queue.ts:574](https://github.com/btravers/amqp-contract/blob/
|
|
1985
|
+
Defined in: [builder/queue.ts:574](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L574)
|
|
1917
1986
|
|
|
1918
1987
|
Create a queue with TTL-backoff retry (exponential backoff).
|
|
1919
1988
|
|
|
@@ -1988,7 +2057,7 @@ const queueName = extractQueue(orderQueue).name;
|
|
|
1988
2057
|
function defineTtlBackoffRetryInfrastructure(queueEntry, options?): TtlBackoffRetryInfrastructure;
|
|
1989
2058
|
```
|
|
1990
2059
|
|
|
1991
|
-
Defined in: [builder/ttl-backoff.ts:68](https://github.com/btravers/amqp-contract/blob/
|
|
2060
|
+
Defined in: [builder/ttl-backoff.ts:68](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/ttl-backoff.ts#L68)
|
|
1992
2061
|
|
|
1993
2062
|
Create TTL-backoff retry infrastructure for a queue.
|
|
1994
2063
|
|
|
@@ -2052,7 +2121,7 @@ const retryInfra = defineTtlBackoffRetryInfrastructure(orderQueue);
|
|
|
2052
2121
|
function extractConsumer(entry): ConsumerDefinition;
|
|
2053
2122
|
```
|
|
2054
2123
|
|
|
2055
|
-
Defined in: [builder/consumer.ts:55](https://github.com/btravers/amqp-contract/blob/
|
|
2124
|
+
Defined in: [builder/consumer.ts:55](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/consumer.ts#L55)
|
|
2056
2125
|
|
|
2057
2126
|
Extract the ConsumerDefinition from any ConsumerEntry type.
|
|
2058
2127
|
|
|
@@ -2101,7 +2170,7 @@ extractConsumer(consumer3).queue.name; // "my-queue"
|
|
|
2101
2170
|
function extractQueue<T>(entry): ExtractQueueFromEntry<T>;
|
|
2102
2171
|
```
|
|
2103
2172
|
|
|
2104
|
-
Defined in: [builder/queue.ts:127](https://github.com/btravers/amqp-contract/blob/
|
|
2173
|
+
Defined in: [builder/queue.ts:127](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L127)
|
|
2105
2174
|
|
|
2106
2175
|
Extract the plain QueueDefinition from a QueueEntry.
|
|
2107
2176
|
|
|
@@ -2170,13 +2239,37 @@ console.log(queueDef.deadLetter); // { exchange: dlx, ... }
|
|
|
2170
2239
|
|
|
2171
2240
|
***
|
|
2172
2241
|
|
|
2242
|
+
### isBridgedPublisherConfig()
|
|
2243
|
+
|
|
2244
|
+
```ts
|
|
2245
|
+
function isBridgedPublisherConfig(value): value is BridgedPublisherConfig<MessageDefinition, ExchangeDefinition, ExchangeDefinition>;
|
|
2246
|
+
```
|
|
2247
|
+
|
|
2248
|
+
Defined in: [builder/command.ts:460](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L460)
|
|
2249
|
+
|
|
2250
|
+
Type guard to check if a value is a BridgedPublisherConfig.
|
|
2251
|
+
|
|
2252
|
+
#### Parameters
|
|
2253
|
+
|
|
2254
|
+
| Parameter | Type | Description |
|
|
2255
|
+
| ------ | ------ | ------ |
|
|
2256
|
+
| `value` | `unknown` | The value to check |
|
|
2257
|
+
|
|
2258
|
+
#### Returns
|
|
2259
|
+
|
|
2260
|
+
`value is BridgedPublisherConfig<MessageDefinition, ExchangeDefinition, ExchangeDefinition>`
|
|
2261
|
+
|
|
2262
|
+
True if the value is a BridgedPublisherConfig
|
|
2263
|
+
|
|
2264
|
+
***
|
|
2265
|
+
|
|
2173
2266
|
### isCommandConsumerConfig()
|
|
2174
2267
|
|
|
2175
2268
|
```ts
|
|
2176
2269
|
function isCommandConsumerConfig(value): value is CommandConsumerConfig<MessageDefinition, ExchangeDefinition, string | undefined, QueueDefinition, ExchangeDefinition | undefined>;
|
|
2177
2270
|
```
|
|
2178
2271
|
|
|
2179
|
-
Defined in: [builder/command.ts:
|
|
2272
|
+
Defined in: [builder/command.ts:443](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/command.ts#L443)
|
|
2180
2273
|
|
|
2181
2274
|
Type guard to check if a value is a CommandConsumerConfig.
|
|
2182
2275
|
|
|
@@ -2197,10 +2290,10 @@ True if the value is a CommandConsumerConfig
|
|
|
2197
2290
|
### isEventConsumerResult()
|
|
2198
2291
|
|
|
2199
2292
|
```ts
|
|
2200
|
-
function isEventConsumerResult(value): value is EventConsumerResult<MessageDefinition, ExchangeDefinition, QueueDefinition, ExchangeDefinition | undefined>;
|
|
2293
|
+
function isEventConsumerResult(value): value is EventConsumerResult<MessageDefinition, ExchangeDefinition, QueueDefinition, ExchangeDefinition | undefined, ExchangeBindingDefinition | undefined, ExchangeDefinition | undefined>;
|
|
2201
2294
|
```
|
|
2202
2295
|
|
|
2203
|
-
Defined in: [builder/event.ts:
|
|
2296
|
+
Defined in: [builder/event.ts:526](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L526)
|
|
2204
2297
|
|
|
2205
2298
|
Type guard to check if a value is an EventConsumerResult.
|
|
2206
2299
|
|
|
@@ -2212,7 +2305,7 @@ Type guard to check if a value is an EventConsumerResult.
|
|
|
2212
2305
|
|
|
2213
2306
|
#### Returns
|
|
2214
2307
|
|
|
2215
|
-
value is EventConsumerResult\<MessageDefinition, ExchangeDefinition, QueueDefinition, ExchangeDefinition \| undefined\>
|
|
2308
|
+
value is EventConsumerResult\<MessageDefinition, ExchangeDefinition, QueueDefinition, ExchangeDefinition \| undefined, ExchangeBindingDefinition \| undefined, ExchangeDefinition \| undefined\>
|
|
2216
2309
|
|
|
2217
2310
|
True if the value is an EventConsumerResult
|
|
2218
2311
|
|
|
@@ -2224,7 +2317,7 @@ True if the value is an EventConsumerResult
|
|
|
2224
2317
|
function isEventPublisherConfig(value): value is EventPublisherConfig<MessageDefinition, ExchangeDefinition, string | undefined>;
|
|
2225
2318
|
```
|
|
2226
2319
|
|
|
2227
|
-
Defined in: [builder/event.ts:
|
|
2320
|
+
Defined in: [builder/event.ts:509](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/event.ts#L509)
|
|
2228
2321
|
|
|
2229
2322
|
Type guard to check if a value is an EventPublisherConfig.
|
|
2230
2323
|
|
|
@@ -2248,7 +2341,7 @@ True if the value is an EventPublisherConfig
|
|
|
2248
2341
|
function isQueueWithTtlBackoffInfrastructure(entry): entry is QueueWithTtlBackoffInfrastructure;
|
|
2249
2342
|
```
|
|
2250
2343
|
|
|
2251
|
-
Defined in: [builder/queue.ts:68](https://github.com/btravers/amqp-contract/blob/
|
|
2344
|
+
Defined in: [builder/queue.ts:68](https://github.com/btravers/amqp-contract/blob/fc480811955c7c63b50aea18b1676c065870bfae/packages/contract/src/builder/queue.ts#L68)
|
|
2252
2345
|
|
|
2253
2346
|
Type guard to check if a queue entry is a QueueWithTtlBackoffInfrastructure.
|
|
2254
2347
|
|