@amqp-contract/contract 0.11.0 → 0.12.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/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/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L12)
15
+ Defined in: [types.ts:12](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/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 = object;
33
33
  ```
34
34
 
35
- Defined in: [types.ts:350](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L350)
35
+ Defined in: [types.ts:376](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L376)
36
36
 
37
37
  Base definition of an AMQP exchange.
38
38
 
@@ -43,11 +43,11 @@ type and routing rules. This type contains properties common to all exchange typ
43
43
 
44
44
  | Property | Type | Description | Defined in |
45
45
  | ------ | ------ | ------ | ------ |
46
- | <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:379](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L379) |
47
- | <a id="autodelete"></a> `autoDelete?` | `boolean` | If true, the exchange is deleted when all queues have finished using it. **Default** `false` | [types.ts:366](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L366) |
48
- | <a id="durable"></a> `durable?` | `boolean` | If true, the exchange survives broker restarts. Durable exchanges are persisted to disk. **Default** `false` | [types.ts:360](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L360) |
49
- | <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:373](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L373) |
50
- | <a id="name"></a> `name` | `string` | The name of the exchange. Must be unique within the RabbitMQ virtual host. | [types.ts:354](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L354) |
46
+ | <a id="arguments"></a> `arguments?` | `Record`&lt;`string`, `unknown`&gt; | 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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L405) |
47
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L392) |
48
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L386) |
49
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L399) |
50
+ | <a id="name"></a> `name` | `string` | The name of the exchange. Must be unique within the RabbitMQ virtual host. | [types.ts:380](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L380) |
51
51
 
52
52
  ***
53
53
 
@@ -59,7 +59,7 @@ type BindingDefinition =
59
59
  | ExchangeBindingDefinition;
60
60
  ```
61
61
 
62
- Defined in: [types.ts:786](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L786)
62
+ Defined in: [types.ts:815](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L815)
63
63
 
64
64
  Union type of all binding definitions.
65
65
 
@@ -75,7 +75,7 @@ A binding can be either:
75
75
  type BindingPattern<S> = S extends "" ? never : S;
76
76
  ```
77
77
 
78
- Defined in: [builder.ts:1069](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1069)
78
+ Defined in: [builder/routing-types.ts:52](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/routing-types.ts#L52)
79
79
 
80
80
  Type-safe binding pattern that validates basic format and wildcards.
81
81
 
@@ -110,7 +110,7 @@ type Invalid = BindingPattern<"">; // never (empty string)
110
110
  type ClassicQueueDefinition = BaseQueueDefinition & object;
111
111
  ```
112
112
 
113
- Defined in: [types.ts:564](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L564)
113
+ Defined in: [types.ts:592](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L592)
114
114
 
115
115
  Definition of a classic queue.
116
116
 
@@ -121,10 +121,10 @@ specific features not supported by quorum queues (e.g., exclusive queues, priori
121
121
 
122
122
  | Name | Type | Description | Defined in |
123
123
  | ------ | ------ | ------ | ------ |
124
- | `deliveryLimit?` | `never` | Classic queues do not support delivery limits. Use type: 'quorum' if you need native retry with delivery limits. | [types.ts:574](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L574) |
125
- | `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:581](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L581) |
126
- | `retry?` | [`TtlBackoffRetryOptions`](#ttlbackoffretryoptions) | Retry configuration for handling failed message processing. Classic queues only support TTL-backoff retry mode. | [types.ts:588](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L588) |
127
- | `type` | `"classic"` | Queue type discriminator: classic queue. | [types.ts:568](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L568) |
124
+ | `deliveryLimit?` | `never` | Classic queues do not support delivery limits. Use type: 'quorum' if you need native retry with delivery limits. | [types.ts:602](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L602) |
125
+ | `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:609](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L609) |
126
+ | `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:617](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L617) |
127
+ | `type` | `"classic"` | Queue type discriminator: classic queue. | [types.ts:596](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L596) |
128
128
 
129
129
  ***
130
130
 
@@ -134,7 +134,7 @@ specific features not supported by quorum queues (e.g., exclusive queues, priori
134
134
  type ClassicQueueOptions = BaseQueueOptions & object;
135
135
  ```
136
136
 
137
- Defined in: [types.ts:292](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L292)
137
+ Defined in: [types.ts:318](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L318)
138
138
 
139
139
  Options for creating a classic queue.
140
140
 
@@ -147,10 +147,10 @@ Classic queues support all traditional RabbitMQ features including:
147
147
 
148
148
  | Name | Type | Description | Defined in |
149
149
  | ------ | ------ | ------ | ------ |
150
- | `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:303](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L303) |
151
- | `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:310](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L310) |
152
- | `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:332](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L332) |
153
- | `type` | `"classic"` | Queue type: classic (for special cases) | [types.ts:296](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L296) |
150
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L329) |
151
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L336) |
152
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L358) |
153
+ | `type` | `"classic"` | Queue type: classic (for special cases) | [types.ts:322](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L322) |
154
154
 
155
155
  #### Example
156
156
 
@@ -170,7 +170,7 @@ const priorityQueue = defineQueue('tasks', {
170
170
  type CompressionAlgorithm = "gzip" | "deflate";
171
171
  ```
172
172
 
173
- Defined in: [types.ts:108](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L108)
173
+ Defined in: [types.ts:134](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L134)
174
174
 
175
175
  Supported compression algorithms for message payloads.
176
176
 
@@ -208,7 +208,7 @@ await client.publish("orderCreated", payload, {
208
208
  type ConsumerDefinition<TMessage> = object;
209
209
  ```
210
210
 
211
- Defined in: [types.ts:847](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L847)
211
+ Defined in: [types.ts:876](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L876)
212
212
 
213
213
  Definition of a message consumer.
214
214
 
@@ -236,8 +236,8 @@ const consumer: ConsumerDefinition = {
236
236
 
237
237
  | Property | Type | Description | Defined in |
238
238
  | ------ | ------ | ------ | ------ |
239
- | <a id="message"></a> `message` | `TMessage` | The message definition including the payload schema | [types.ts:852](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L852) |
240
- | <a id="queue"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The queue to consume messages from | [types.ts:849](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L849) |
239
+ | <a id="message"></a> `message` | `TMessage` | The message definition including the payload schema | [types.ts:881](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L881) |
240
+ | <a id="queue"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The queue to consume messages from | [types.ts:878](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L878) |
241
241
 
242
242
  ***
243
243
 
@@ -247,7 +247,7 @@ const consumer: ConsumerDefinition = {
247
247
  type ConsumerFirstResult<TMessage, TConsumer, TBinding> = object;
248
248
  ```
249
249
 
250
- Defined in: [builder.ts:1446](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1446)
250
+ Defined in: [builder/consumer-first.ts:27](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L27)
251
251
 
252
252
  Consumer-first builder result for fanout and direct exchanges.
253
253
 
@@ -259,16 +259,16 @@ a publisher that uses the same message schema and routing key.
259
259
  | Type Parameter | Description |
260
260
  | ------ | ------ |
261
261
  | `TMessage` *extends* [`MessageDefinition`](#messagedefinition) | The message definition |
262
- | `TConsumer` *extends* [`ConsumerDefinition`](#consumerdefinition)\<`TMessage`\> | The consumer definition |
262
+ | `TConsumer` *extends* [`ConsumerDefinition`](#consumerdefinition)&lt;`TMessage`&gt; | The consumer definition |
263
263
  | `TBinding` *extends* [`QueueBindingDefinition`](#queuebindingdefinition) | The queue binding definition |
264
264
 
265
265
  #### Properties
266
266
 
267
267
  | Property | Type | Description | Defined in |
268
268
  | ------ | ------ | ------ | ------ |
269
- | <a id="binding"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder.ts:1454](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1454) |
270
- | <a id="consumer"></a> `consumer` | `TConsumer` | The consumer definition | [builder.ts:1452](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1452) |
271
- | <a id="createpublisher"></a> `createPublisher` | () => `TBinding`\[`"exchange"`\] *extends* [`FanoutExchangeDefinition`](#fanoutexchangedefinition) ? `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: [`FanoutExchangeDefinition`](#fanoutexchangedefinition); \}\> : `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}\> | Create a publisher that sends messages to this consumer. The publisher will automatically use the same message schema and routing key. | [builder.ts:1461](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1461) |
269
+ | <a id="binding"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder/consumer-first.ts:35](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L35) |
270
+ | <a id="consumer"></a> `consumer` | `TConsumer` | The consumer definition | [builder/consumer-first.ts:33](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L33) |
271
+ | <a id="createpublisher"></a> `createPublisher` | () => `TBinding`\[`"exchange"`\] *extends* [`FanoutExchangeDefinition`](#fanoutexchangedefinition) ? `Extract`&lt;[`PublisherDefinition`](#publisherdefinition)&lt;`TMessage`&gt;, \{ `exchange`: [`FanoutExchangeDefinition`](#fanoutexchangedefinition); \}&gt; : `Extract`&lt;[`PublisherDefinition`](#publisherdefinition)&lt;`TMessage`&gt;, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}&gt; | Create a publisher that sends messages to this consumer. The publisher will automatically use the same message schema and routing key. | [builder/consumer-first.ts:42](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L42) |
272
272
 
273
273
  ***
274
274
 
@@ -278,7 +278,7 @@ a publisher that uses the same message schema and routing key.
278
278
  type ConsumerFirstResultWithRoutingKey<TMessage, TConsumer, TBinding> = object;
279
279
  ```
280
280
 
281
- Defined in: [builder.ts:1479](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1479)
281
+ Defined in: [builder/consumer-first.ts:60](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L60)
282
282
 
283
283
  Consumer-first builder result for topic exchanges.
284
284
 
@@ -290,16 +290,16 @@ a method to create a publisher with a concrete routing key that matches the patt
290
290
  | Type Parameter | Description |
291
291
  | ------ | ------ |
292
292
  | `TMessage` *extends* [`MessageDefinition`](#messagedefinition) | The message definition |
293
- | `TConsumer` *extends* [`ConsumerDefinition`](#consumerdefinition)\<`TMessage`\> | The consumer definition |
293
+ | `TConsumer` *extends* [`ConsumerDefinition`](#consumerdefinition)&lt;`TMessage`&gt; | The consumer definition |
294
294
  | `TBinding` *extends* [`QueueBindingDefinition`](#queuebindingdefinition) | The queue binding definition |
295
295
 
296
296
  #### Properties
297
297
 
298
298
  | Property | Type | Description | Defined in |
299
299
  | ------ | ------ | ------ | ------ |
300
- | <a id="binding-1"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder.ts:1487](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1487) |
301
- | <a id="consumer-1"></a> `consumer` | `TConsumer` | The consumer definition | [builder.ts:1485](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1485) |
302
- | <a id="createpublisher-1"></a> `createPublisher` | \<`TPublisherRoutingKey`\>(`routingKey`) => `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}\> | Create a publisher that sends messages to this consumer. For topic exchanges, the routing key can be specified to match the binding pattern. | [builder.ts:1495](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1495) |
300
+ | <a id="binding-1"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder/consumer-first.ts:68](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L68) |
301
+ | <a id="consumer-1"></a> `consumer` | `TConsumer` | The consumer definition | [builder/consumer-first.ts:66](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L66) |
302
+ | <a id="createpublisher-1"></a> `createPublisher` | &lt;`TPublisherRoutingKey`&gt;(`routingKey`) => `Extract`&lt;[`PublisherDefinition`](#publisherdefinition)&lt;`TMessage`&gt;, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}&gt; | Create a publisher that sends messages to this consumer. For topic exchanges, the routing key can be specified to match the binding pattern. | [builder/consumer-first.ts:76](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer-first.ts#L76) |
303
303
 
304
304
  ***
305
305
 
@@ -309,7 +309,7 @@ a method to create a publisher with a concrete routing key that matches the patt
309
309
  type ContractDefinition = object;
310
310
  ```
311
311
 
312
- Defined in: [types.ts:888](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L888)
312
+ Defined in: [types.ts:917](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L917)
313
313
 
314
314
  Complete AMQP contract definition.
315
315
 
@@ -348,11 +348,11 @@ const contract: ContractDefinition = {
348
348
 
349
349
  | Property | Type | Description | Defined in |
350
350
  | ------ | ------ | ------ | ------ |
351
- | <a id="bindings"></a> `bindings?` | `Record`\<`string`, [`BindingDefinition`](#bindingdefinition)\> | Named binding definitions. Bindings can be queue-to-exchange or exchange-to-exchange. | [types.ts:908](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L908) |
352
- | <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:922](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L922) |
353
- | <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:893](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L893) |
354
- | <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:915](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L915) |
355
- | <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:902](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L902) |
351
+ | <a id="bindings"></a> `bindings?` | `Record`&lt;`string`, [`BindingDefinition`](#bindingdefinition)&gt; | Named binding definitions. Bindings can be queue-to-exchange or exchange-to-exchange. | [types.ts:937](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L937) |
352
+ | <a id="consumers"></a> `consumers?` | `Record`&lt;`string`, [`ConsumerDefinition`](#consumerdefinition)&gt; | 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:951](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L951) |
353
+ | <a id="exchanges"></a> `exchanges?` | `Record`&lt;`string`, [`ExchangeDefinition`](#exchangedefinition)&gt; | Named exchange definitions. Each key becomes available as a named resource in the contract. | [types.ts:922](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L922) |
354
+ | <a id="publishers"></a> `publishers?` | `Record`&lt;`string`, [`PublisherDefinition`](#publisherdefinition)&gt; | 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:944](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L944) |
355
+ | <a id="queues"></a> `queues?` | `Record`&lt;`string`, [`QueueEntry`](#queueentry)&gt; | 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:931](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L931) |
356
356
 
357
357
  ***
358
358
 
@@ -362,7 +362,7 @@ const contract: ContractDefinition = {
362
362
  type DeadLetterConfig = object;
363
363
  ```
364
364
 
365
- Defined in: [types.ts:454](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L454)
365
+ Defined in: [types.ts:480](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L480)
366
366
 
367
367
  Configuration for dead letter exchange (DLX) on a queue.
368
368
 
@@ -374,8 +374,8 @@ or storage.
374
374
 
375
375
  | Property | Type | Description | Defined in |
376
376
  | ------ | ------ | ------ | ------ |
377
- | <a id="exchange"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | The exchange to send dead-lettered messages to. This exchange must be declared in the contract. | [types.ts:459](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L459) |
378
- | <a id="routingkey"></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:465](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L465) |
377
+ | <a id="exchange"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | The exchange to send dead-lettered messages to. This exchange must be declared in the contract. | [types.ts:485](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L485) |
378
+ | <a id="routingkey"></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:491](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L491) |
379
379
 
380
380
  ***
381
381
 
@@ -387,7 +387,7 @@ type DefineQueueOptions =
387
387
  | ClassicQueueOptions;
388
388
  ```
389
389
 
390
- Defined in: [types.ts:342](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L342)
390
+ Defined in: [types.ts:368](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L368)
391
391
 
392
392
  Options for defining a queue. Uses a discriminated union based on the `type` property
393
393
  to enforce quorum queue constraints at compile time.
@@ -403,7 +403,7 @@ to enforce quorum queue constraints at compile time.
403
403
  type DirectExchangeDefinition = BaseExchangeDefinition & object;
404
404
  ```
405
405
 
406
- Defined in: [types.ts:412](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L412)
406
+ Defined in: [types.ts:438](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L438)
407
407
 
408
408
  A direct exchange definition.
409
409
 
@@ -414,7 +414,7 @@ This is ideal for point-to-point messaging where each message should go to speci
414
414
 
415
415
  | Name | Type | Defined in |
416
416
  | ------ | ------ | ------ |
417
- | `type` | `"direct"` | [types.ts:413](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L413) |
417
+ | `type` | `"direct"` | [types.ts:439](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L439) |
418
418
 
419
419
  #### Example
420
420
 
@@ -441,7 +441,7 @@ type ExchangeBindingDefinition = object &
441
441
  };
442
442
  ```
443
443
 
444
- Defined in: [types.ts:750](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L750)
444
+ Defined in: [types.ts:779](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L779)
445
445
 
446
446
  Binding between two exchanges (exchange-to-exchange routing).
447
447
 
@@ -452,9 +452,9 @@ This allows for more complex routing topologies.
452
452
 
453
453
  | Name | Type | Description | Defined in |
454
454
  | ------ | ------ | ------ | ------ |
455
- | `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for the binding. | [types.ts:760](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L760) |
456
- | `destination` | [`ExchangeDefinition`](#exchangedefinition) | The destination exchange that will receive forwarded messages | [types.ts:755](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L755) |
457
- | `type` | `"exchange"` | Discriminator indicating this is an exchange-to-exchange binding | [types.ts:752](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L752) |
455
+ | `arguments?` | `Record`&lt;`string`, `unknown`&gt; | Additional AMQP arguments for the binding. | [types.ts:789](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L789) |
456
+ | `destination` | [`ExchangeDefinition`](#exchangedefinition) | The destination exchange that will receive forwarded messages | [types.ts:784](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L784) |
457
+ | `type` | `"exchange"` | Discriminator indicating this is an exchange-to-exchange binding | [types.ts:781](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L781) |
458
458
 
459
459
  #### Example
460
460
 
@@ -479,7 +479,7 @@ type ExchangeDefinition =
479
479
  | TopicExchangeDefinition;
480
480
  ```
481
481
 
482
- Defined in: [types.ts:442](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L442)
482
+ Defined in: [types.ts:468](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L468)
483
483
 
484
484
  Union type of all exchange definitions.
485
485
 
@@ -493,7 +493,7 @@ Represents any type of AMQP exchange: fanout, direct, or topic.
493
493
  type FanoutExchangeDefinition = BaseExchangeDefinition & object;
494
494
  ```
495
495
 
496
- Defined in: [types.ts:395](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L395)
496
+ Defined in: [types.ts:421](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L421)
497
497
 
498
498
  A fanout exchange definition.
499
499
 
@@ -504,7 +504,7 @@ This is the simplest exchange type for pub/sub messaging patterns.
504
504
 
505
505
  | Name | Type | Defined in |
506
506
  | ------ | ------ | ------ |
507
- | `type` | `"fanout"` | [types.ts:396](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L396) |
507
+ | `type` | `"fanout"` | [types.ts:422](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L422) |
508
508
 
509
509
  #### Example
510
510
 
@@ -522,7 +522,7 @@ const logsExchange: FanoutExchangeDefinition = defineExchange('logs', 'fanout',
522
522
  type InferConsumerNames<TContract> = TContract["consumers"] extends Record<string, unknown> ? keyof TContract["consumers"] : never;
523
523
  ```
524
524
 
525
- Defined in: [types.ts:958](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L958)
525
+ Defined in: [types.ts:987](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L987)
526
526
 
527
527
  Extract consumer names from a contract.
528
528
 
@@ -554,7 +554,7 @@ type ConsumerNames = InferConsumerNames<typeof myContract>;
554
554
  type InferPublisherNames<TContract> = TContract["publishers"] extends Record<string, unknown> ? keyof TContract["publishers"] : never;
555
555
  ```
556
556
 
557
- Defined in: [types.ts:940](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L940)
557
+ Defined in: [types.ts:969](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L969)
558
558
 
559
559
  Extract publisher names from a contract.
560
560
 
@@ -586,7 +586,7 @@ type PublisherNames = InferPublisherNames<typeof myContract>;
586
586
  type MatchingRoutingKey<Pattern, Key> = RoutingKey<Key> extends never ? never : BindingPattern<Pattern> extends never ? never : MatchesPattern<Key, Pattern> extends true ? Key : never;
587
587
  ```
588
588
 
589
- Defined in: [builder.ts:1131](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1131)
589
+ Defined in: [builder/routing-types.ts:114](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/routing-types.ts#L114)
590
590
 
591
591
  Validate that a routing key matches a binding pattern.
592
592
 
@@ -618,7 +618,7 @@ type InvalidKey = MatchingRoutingKey<"order.*", "user.created">; // never
618
618
  type MessageDefinition<TPayload, THeaders> = object;
619
619
  ```
620
620
 
621
- Defined in: [types.ts:666](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L666)
621
+ Defined in: [types.ts:695](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L695)
622
622
 
623
623
  Definition of a message with typed payload and optional headers.
624
624
 
@@ -627,16 +627,16 @@ Definition of a message with typed payload and optional headers.
627
627
  | Type Parameter | Default type | Description |
628
628
  | ------ | ------ | ------ |
629
629
  | `TPayload` *extends* [`AnySchema`](#anyschema) | [`AnySchema`](#anyschema) | The Standard Schema v1 compatible schema for the message payload |
630
- | `THeaders` *extends* `StandardSchemaV1`\<`Record`\<`string`, `unknown`\>\> \| `undefined` | `undefined` | The Standard Schema v1 compatible schema for the message headers (optional) |
630
+ | `THeaders` *extends* \| `StandardSchemaV1`&lt;`Record`&lt;`string`, `unknown`&gt;&gt; \| `undefined` | `undefined` | The Standard Schema v1 compatible schema for the message headers (optional) |
631
631
 
632
632
  #### Properties
633
633
 
634
634
  | Property | Type | Description | Defined in |
635
635
  | ------ | ------ | ------ | ------ |
636
- | <a id="description"></a> `description?` | `string` | Detailed description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:692](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L692) |
637
- | <a id="headers"></a> `headers?` | `THeaders` | Optional headers schema for validating message metadata. Must be a Standard Schema v1 compatible schema. | [types.ts:680](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L680) |
638
- | <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:674](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L674) |
639
- | <a id="summary"></a> `summary?` | `string` | Brief description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:686](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L686) |
636
+ | <a id="description"></a> `description?` | `string` | Detailed description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:721](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L721) |
637
+ | <a id="headers"></a> `headers?` | `THeaders` | Optional headers schema for validating message metadata. Must be a Standard Schema v1 compatible schema. | [types.ts:709](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L709) |
638
+ | <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:703](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L703) |
639
+ | <a id="summary"></a> `summary?` | `string` | Brief description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:715](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L715) |
640
640
 
641
641
  ***
642
642
 
@@ -655,7 +655,7 @@ type PublisherDefinition<TMessage> = object &
655
655
  };
656
656
  ```
657
657
 
658
- Defined in: [types.ts:808](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L808)
658
+ Defined in: [types.ts:837](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L837)
659
659
 
660
660
  Definition of a message publisher.
661
661
 
@@ -669,7 +669,7 @@ algorithm when calling the publish method.
669
669
 
670
670
  | Name | Type | Description | Defined in |
671
671
  | ------ | ------ | ------ | ------ |
672
- | `message` | `TMessage` | The message definition including the payload schema | [types.ts:810](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L810) |
672
+ | `message` | `TMessage` | The message definition including the payload schema | [types.ts:839](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L839) |
673
673
 
674
674
  #### Type Parameters
675
675
 
@@ -695,7 +695,7 @@ const publisher: PublisherDefinition = {
695
695
  type PublisherFirstResult<TMessage, TPublisher> = object;
696
696
  ```
697
697
 
698
- Defined in: [builder.ts:998](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L998)
698
+ Defined in: [builder/publisher-first.ts:29](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/publisher-first.ts#L29)
699
699
 
700
700
  Publisher-first builder result for fanout and direct exchanges.
701
701
 
@@ -710,14 +710,14 @@ emit events without knowing which queues will consume them.
710
710
  | Type Parameter | Description |
711
711
  | ------ | ------ |
712
712
  | `TMessage` *extends* [`MessageDefinition`](#messagedefinition) | The message definition |
713
- | `TPublisher` *extends* [`PublisherDefinition`](#publisherdefinition)\<`TMessage`\> | The publisher definition |
713
+ | `TPublisher` *extends* [`PublisherDefinition`](#publisherdefinition)&lt;`TMessage`&gt; | The publisher definition |
714
714
 
715
715
  #### Properties
716
716
 
717
717
  | Property | Type | Description | Defined in |
718
718
  | ------ | ------ | ------ | ------ |
719
- | <a id="createconsumer"></a> `createConsumer` | (`queue`) => `object` | Create a consumer that receives messages from this publisher. The consumer will automatically use the same message schema and a binding will be created with the same routing key. | [builder.ts:1012](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1012) |
720
- | <a id="publisher"></a> `publisher` | `TPublisher` | The publisher definition | [builder.ts:1003](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1003) |
719
+ | <a id="createconsumer"></a> `createConsumer` | (`queue`) => `object` | Create a consumer that receives messages from this publisher. The consumer will automatically use the same message schema and a binding will be created with the same routing key. | [builder/publisher-first.ts:43](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/publisher-first.ts#L43) |
720
+ | <a id="publisher"></a> `publisher` | `TPublisher` | The publisher definition | [builder/publisher-first.ts:34](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/publisher-first.ts#L34) |
721
721
 
722
722
  ***
723
723
 
@@ -727,7 +727,7 @@ emit events without knowing which queues will consume them.
727
727
  type PublisherFirstResultWithRoutingKey<TMessage, TPublisher, TRoutingKey> = object;
728
728
  ```
729
729
 
730
- Defined in: [builder.ts:1150](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1150)
730
+ Defined in: [builder/publisher-first.ts:59](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/publisher-first.ts#L59)
731
731
 
732
732
  Publisher-first builder result for topic exchanges.
733
733
 
@@ -739,15 +739,15 @@ to create consumers that can use routing key patterns matching the publisher's k
739
739
  | Type Parameter | Description |
740
740
  | ------ | ------ |
741
741
  | `TMessage` *extends* [`MessageDefinition`](#messagedefinition) | The message definition |
742
- | `TPublisher` *extends* [`PublisherDefinition`](#publisherdefinition)\<`TMessage`\> | The publisher definition |
742
+ | `TPublisher` *extends* [`PublisherDefinition`](#publisherdefinition)&lt;`TMessage`&gt; | The publisher definition |
743
743
  | `TRoutingKey` *extends* `string` | The literal routing key type from the publisher (for documentation purposes) |
744
744
 
745
745
  #### Properties
746
746
 
747
747
  | Property | Type | Description | Defined in |
748
748
  | ------ | ------ | ------ | ------ |
749
- | <a id="createconsumer-1"></a> `createConsumer` | \<`TConsumerRoutingKey`\>(`queue`, `routingKey?`) => `object` | Create a consumer that receives messages from this publisher. For topic exchanges, the routing key pattern can be specified for the binding. | [builder.ts:1165](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1165) |
750
- | <a id="publisher-1"></a> `publisher` | `TPublisher` | The publisher definition | [builder.ts:1156](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1156) |
749
+ | <a id="createconsumer-1"></a> `createConsumer` | &lt;`TConsumerRoutingKey`&gt;(`queue`, `routingKey?`) => `object` | Create a consumer that receives messages from this publisher. For topic exchanges, the routing key pattern can be specified for the binding. | [builder/publisher-first.ts:74](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/publisher-first.ts#L74) |
750
+ | <a id="publisher-1"></a> `publisher` | `TPublisher` | The publisher definition | [builder/publisher-first.ts:65](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/publisher-first.ts#L65) |
751
751
 
752
752
  ***
753
753
 
@@ -766,7 +766,7 @@ type QueueBindingDefinition = object &
766
766
  };
767
767
  ```
768
768
 
769
- Defined in: [types.ts:702](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L702)
769
+ Defined in: [types.ts:731](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L731)
770
770
 
771
771
  Binding between a queue and an exchange.
772
772
 
@@ -778,9 +778,9 @@ For fanout exchanges, no routing key is needed as all messages are broadcast.
778
778
 
779
779
  | Name | Type | Description | Defined in |
780
780
  | ------ | ------ | ------ | ------ |
781
- | `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for the binding. Can be used for advanced routing scenarios with the headers exchange type. | [types.ts:713](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L713) |
782
- | `queue` | [`QueueDefinition`](#queuedefinition) | The queue that will receive messages | [types.ts:707](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L707) |
783
- | `type` | `"queue"` | Discriminator indicating this is a queue-to-exchange binding | [types.ts:704](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L704) |
781
+ | `arguments?` | `Record`&lt;`string`, `unknown`&gt; | Additional AMQP arguments for the binding. Can be used for advanced routing scenarios with the headers exchange type. | [types.ts:742](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L742) |
782
+ | `queue` | [`QueueDefinition`](#queuedefinition) | The queue that will receive messages | [types.ts:736](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L736) |
783
+ | `type` | `"queue"` | Discriminator indicating this is a queue-to-exchange binding | [types.ts:733](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L733) |
784
784
 
785
785
  ***
786
786
 
@@ -792,7 +792,7 @@ type QueueDefinition =
792
792
  | ClassicQueueDefinition;
793
793
  ```
794
794
 
795
- Defined in: [types.ts:600](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L600)
795
+ Defined in: [types.ts:629](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L629)
796
796
 
797
797
  Definition of an AMQP queue.
798
798
 
@@ -812,7 +812,7 @@ type QueueEntry =
812
812
  | QueueWithTtlBackoffInfrastructure;
813
813
  ```
814
814
 
815
- Defined in: [types.ts:658](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L658)
815
+ Defined in: [types.ts:687](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L687)
816
816
 
817
817
  A queue entry that can be passed to `defineContract`.
818
818
 
@@ -826,7 +826,7 @@ Can be either a plain queue definition or a queue with TTL-backoff infrastructur
826
826
  type QueueType = "quorum" | "classic";
827
827
  ```
828
828
 
829
- Defined in: [types.ts:137](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L137)
829
+ Defined in: [types.ts:163](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L163)
830
830
 
831
831
  Supported queue types in RabbitMQ.
832
832
 
@@ -865,7 +865,7 @@ const tempQueue = defineQueue('temp-queue', {
865
865
  type QueueWithTtlBackoffInfrastructure = object;
866
866
  ```
867
867
 
868
- Defined in: [types.ts:625](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L625)
868
+ Defined in: [types.ts:654](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L654)
869
869
 
870
870
  A queue with automatically generated TTL-backoff retry infrastructure.
871
871
 
@@ -894,10 +894,10 @@ const contract = defineContract({
894
894
 
895
895
  | Property | Type | Description | Defined in |
896
896
  | ------ | ------ | ------ | ------ |
897
- | <a id="mainqueueretrybinding"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [types.ts:650](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L650) |
898
- | <a id="queue-1"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The main queue definition. | [types.ts:635](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L635) |
899
- | <a id="waitqueue"></a> `waitQueue` | [`QueueDefinition`](#queuedefinition) | The wait queue for holding messages during backoff delay. | [types.ts:640](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L640) |
900
- | <a id="waitqueuebinding"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [types.ts:645](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L645) |
897
+ | <a id="mainqueueretrybinding"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [types.ts:679](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L679) |
898
+ | <a id="queue-1"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The main queue definition. | [types.ts:664](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L664) |
899
+ | <a id="waitqueue"></a> `waitQueue` | [`QueueDefinition`](#queuedefinition) | The wait queue for holding messages during backoff delay. | [types.ts:669](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L669) |
900
+ | <a id="waitqueuebinding"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [types.ts:674](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L674) |
901
901
 
902
902
  ***
903
903
 
@@ -907,7 +907,7 @@ const contract = defineContract({
907
907
  type QuorumNativeRetryOptions = object;
908
908
  ```
909
909
 
910
- Defined in: [types.ts:72](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L72)
910
+ Defined in: [types.ts:72](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L72)
911
911
 
912
912
  Quorum-Native retry options using RabbitMQ's native delivery limit feature.
913
913
 
@@ -927,7 +927,7 @@ https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling
927
927
 
928
928
  | Property | Type | Description | Defined in |
929
929
  | ------ | ------ | ------ | ------ |
930
- | <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/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L77) |
930
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L77) |
931
931
 
932
932
  ***
933
933
 
@@ -937,7 +937,7 @@ https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling
937
937
  type QuorumQueueDefinition = BaseQueueDefinition & object;
938
938
  ```
939
939
 
940
- Defined in: [types.ts:516](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L516)
940
+ Defined in: [types.ts:542](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L542)
941
941
 
942
942
  Definition of a quorum queue.
943
943
 
@@ -948,11 +948,11 @@ They support native retry handling via `deliveryLimit` and both TTL-backoff and
948
948
 
949
949
  | Name | Type | Description | Defined in |
950
950
  | ------ | ------ | ------ | ------ |
951
- | `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:546](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L546) |
952
- | `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:526](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L526) |
953
- | `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:532](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L532) |
954
- | `retry?` | \| [`TtlBackoffRetryOptions`](#ttlbackoffretryoptions) \| [`QuorumNativeRetryOptions`](#quorumnativeretryoptions) | Retry configuration for handling failed message processing. Quorum queues support both: - `ttl-backoff`: Uses wait queues with exponential backoff - `quorum-native`: Uses RabbitMQ's native delivery limit feature | [types.ts:555](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L555) |
955
- | `type` | `"quorum"` | Queue type discriminator: quorum queue. | [types.ts:520](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L520) |
951
+ | `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:572](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L572) |
952
+ | `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:552](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L552) |
953
+ | `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:558](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L558) |
954
+ | `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:583](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L583) |
955
+ | `type` | `"quorum"` | Queue type discriminator: quorum queue. | [types.ts:546](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L546) |
956
956
 
957
957
  ***
958
958
 
@@ -962,7 +962,7 @@ They support native retry handling via `deliveryLimit` and both TTL-backoff and
962
962
  type QuorumQueueOptions = BaseQueueOptions & object;
963
963
  ```
964
964
 
965
- Defined in: [types.ts:188](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L188)
965
+ Defined in: [types.ts:214](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L214)
966
966
 
967
967
  Options for creating a quorum queue.
968
968
 
@@ -979,11 +979,11 @@ Quorum queues provide native retry support via `deliveryLimit`:
979
979
 
980
980
  | Name | Type | Description | Defined in |
981
981
  | ------ | ------ | ------ | ------ |
982
- | `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:237](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L237) |
983
- | `exclusive?` | `never` | Quorum queues do not support exclusive mode. Use type: 'classic' if you need exclusive queues. | [types.ts:198](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L198) |
984
- | `maxPriority?` | `never` | Quorum queues do not support priority queues. Use type: 'classic' if you need priority queues. | [types.ts:204](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L204) |
985
- | `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:272](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L272) |
986
- | `type?` | `"quorum"` | Queue type: quorum (default, recommended) | [types.ts:192](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L192) |
982
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L263) |
983
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L224) |
984
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L230) |
985
+ | `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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L298) |
986
+ | `type?` | `"quorum"` | Queue type: quorum (default, recommended) | [types.ts:218](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L218) |
987
987
 
988
988
  #### Example
989
989
 
@@ -997,13 +997,31 @@ const orderQueue = defineQueue('orders', {
997
997
 
998
998
  ***
999
999
 
1000
+ ### ResolvedRetryOptions
1001
+
1002
+ ```ts
1003
+ type ResolvedRetryOptions =
1004
+ | ResolvedTtlBackoffRetryOptions
1005
+ | QuorumNativeRetryOptions;
1006
+ ```
1007
+
1008
+ Defined in: [types.ts:104](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L104)
1009
+
1010
+ Resolved retry configuration stored in queue definitions.
1011
+
1012
+ This is a discriminated union based on the `mode` field:
1013
+ - `ttl-backoff`: Has all TTL-backoff options with defaults applied
1014
+ - `quorum-native`: No additional options (uses RabbitMQ native retry)
1015
+
1016
+ ***
1017
+
1000
1018
  ### RoutingKey
1001
1019
 
1002
1020
  ```ts
1003
1021
  type RoutingKey<S> = S extends "" ? never : S extends `${string}*${string}` | `${string}#${string}` ? never : S;
1004
1022
  ```
1005
1023
 
1006
- Defined in: [builder.ts:1042](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1042)
1024
+ Defined in: [builder/routing-types.ts:25](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/routing-types.ts#L25)
1007
1025
 
1008
1026
  Type-safe routing key that validates basic format.
1009
1027
 
@@ -1037,7 +1055,7 @@ type Invalid2 = RoutingKey<"">; // never (empty string)
1037
1055
  type TopicExchangeDefinition = BaseExchangeDefinition & object;
1038
1056
  ```
1039
1057
 
1040
- Defined in: [types.ts:433](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L433)
1058
+ Defined in: [types.ts:459](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L459)
1041
1059
 
1042
1060
  A topic exchange definition.
1043
1061
 
@@ -1051,7 +1069,7 @@ Words are separated by dots (e.g., `order.created.high-value`).
1051
1069
 
1052
1070
  | Name | Type | Defined in |
1053
1071
  | ------ | ------ | ------ |
1054
- | `type` | `"topic"` | [types.ts:434](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L434) |
1072
+ | `type` | `"topic"` | [types.ts:460](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L460) |
1055
1073
 
1056
1074
  #### Example
1057
1075
 
@@ -1070,7 +1088,7 @@ const ordersExchange: TopicExchangeDefinition = defineExchange('orders', 'topic'
1070
1088
  type TtlBackoffRetryInfrastructure = object;
1071
1089
  ```
1072
1090
 
1073
- Defined in: [builder.ts:1760](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1760)
1091
+ Defined in: [builder/ttl-backoff.ts:10](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/ttl-backoff.ts#L10)
1074
1092
 
1075
1093
  Result type for TTL-backoff retry infrastructure builder.
1076
1094
 
@@ -1080,9 +1098,9 @@ Contains the wait queue and bindings needed for TTL-backoff retry.
1080
1098
 
1081
1099
  | Property | Type | Description | Defined in |
1082
1100
  | ------ | ------ | ------ | ------ |
1083
- | <a id="mainqueueretrybinding-1"></a> `mainQueueRetryBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes retried messages back to the main queue. | [builder.ts:1773](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1773) |
1084
- | <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.ts:1765](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1765) |
1085
- | <a id="waitqueuebinding-1"></a> `waitQueueBinding` | [`QueueBindingDefinition`](#queuebindingdefinition) | Binding that routes failed messages to the wait queue. | [builder.ts:1769](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1769) |
1101
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/ttl-backoff.ts#L23) |
1102
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/ttl-backoff.ts#L15) |
1103
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/ttl-backoff.ts#L19) |
1086
1104
 
1087
1105
  ***
1088
1106
 
@@ -1092,7 +1110,7 @@ Contains the wait queue and bindings needed for TTL-backoff retry.
1092
1110
  type TtlBackoffRetryOptions = object;
1093
1111
  ```
1094
1112
 
1095
- Defined in: [types.ts:27](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L27)
1113
+ Defined in: [types.ts:27](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L27)
1096
1114
 
1097
1115
  TTL-Backoff retry options for exponential backoff with configurable delays.
1098
1116
 
@@ -1106,12 +1124,12 @@ per-message TTL, then dead-lettered back to the main queue after the TTL expires
1106
1124
 
1107
1125
  | Property | Type | Description | Defined in |
1108
1126
  | ------ | ------ | ------ | ------ |
1109
- | <a id="backoffmultiplier"></a> `backoffMultiplier?` | `number` | Exponential backoff multiplier. **Default** `2` | [types.ts:51](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L51) |
1110
- | <a id="initialdelayms"></a> `initialDelayMs?` | `number` | Initial delay in ms before first retry. **Default** `1000` | [types.ts:41](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L41) |
1111
- | <a id="jitter"></a> `jitter?` | `boolean` | Add jitter to prevent thundering herd. **Default** `true` | [types.ts:56](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L56) |
1112
- | <a id="maxdelayms"></a> `maxDelayMs?` | `number` | Maximum delay in ms between retries. **Default** `30000` | [types.ts:46](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L46) |
1113
- | <a id="maxretries"></a> `maxRetries?` | `number` | Maximum retry attempts before sending to DLQ. **Default** `3` | [types.ts:36](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L36) |
1114
- | <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/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/types.ts#L31) |
1127
+ | <a id="backoffmultiplier"></a> `backoffMultiplier?` | `number` | Exponential backoff multiplier. **Default** `2` | [types.ts:51](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L51) |
1128
+ | <a id="initialdelayms"></a> `initialDelayMs?` | `number` | Initial delay in ms before first retry. **Default** `1000` | [types.ts:41](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L41) |
1129
+ | <a id="jitter"></a> `jitter?` | `boolean` | Add jitter to prevent thundering herd. **Default** `true` | [types.ts:56](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L56) |
1130
+ | <a id="maxdelayms"></a> `maxDelayMs?` | `number` | Maximum delay in ms between retries. **Default** `30000` | [types.ts:46](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L46) |
1131
+ | <a id="maxretries"></a> `maxRetries?` | `number` | Maximum retry attempts before sending to DLQ. **Default** `3` | [types.ts:36](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L36) |
1132
+ | <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/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/types.ts#L31) |
1115
1133
 
1116
1134
  ## Functions
1117
1135
 
@@ -1121,10 +1139,10 @@ per-message TTL, then dead-lettered back to the main queue after the TTL expires
1121
1139
  function defineConsumer<TMessage>(
1122
1140
  queue,
1123
1141
  message,
1124
- options?): ConsumerDefinition<TMessage>;
1142
+ options?): ConsumerDefinition<TMessage>;
1125
1143
  ```
1126
1144
 
1127
- Defined in: [builder.ts:782](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L782)
1145
+ Defined in: [builder/consumer.ts:46](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/consumer.ts#L46)
1128
1146
 
1129
1147
  Define a message consumer.
1130
1148
 
@@ -1146,11 +1164,11 @@ with this consumer, it will process messages from the queue according to the sch
1146
1164
  | ------ | ------ | ------ |
1147
1165
  | `queue` | [`QueueEntry`](#queueentry) | The queue definition to consume from |
1148
1166
  | `message` | `TMessage` | The message definition with payload schema |
1149
- | `options?` | `Omit`\<[`ConsumerDefinition`](#consumerdefinition)\<`TMessage`\>, `"queue"` \| `"message"`\> | Optional consumer configuration |
1167
+ | `options?` | `Omit`&lt;[`ConsumerDefinition`](#consumerdefinition)&lt;`TMessage`&gt;, `"queue"` \| `"message"`&gt; | Optional consumer configuration |
1150
1168
 
1151
1169
  #### Returns
1152
1170
 
1153
- [`ConsumerDefinition`](#consumerdefinition)\<`TMessage`\>
1171
+ [`ConsumerDefinition`](#consumerdefinition)&lt;`TMessage`&gt;
1154
1172
 
1155
1173
  A consumer definition with inferred message types
1156
1174
 
@@ -1191,7 +1209,7 @@ const processOrderConsumer = defineConsumer(orderQueue, orderMessage);
1191
1209
  function defineContract<TContract>(definition): TContract;
1192
1210
  ```
1193
1211
 
1194
- Defined in: [builder.ts:863](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L863)
1212
+ Defined in: [builder/contract.ts:73](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/contract.ts#L73)
1195
1213
 
1196
1214
  Define an AMQP contract.
1197
1215
 
@@ -1280,7 +1298,7 @@ export const contract = defineContract({
1280
1298
  function defineMessage<TPayload, THeaders>(payload, options?): MessageDefinition<TPayload, THeaders>;
1281
1299
  ```
1282
1300
 
1283
- Defined in: [builder.ts:381](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L381)
1301
+ Defined in: [builder/message.ts:39](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/message.ts#L39)
1284
1302
 
1285
1303
  Define a message definition with payload and optional headers/metadata.
1286
1304
 
@@ -1293,7 +1311,7 @@ The schemas are used for automatic validation when publishing or consuming messa
1293
1311
  | Type Parameter | Default type |
1294
1312
  | ------ | ------ |
1295
1313
  | `TPayload` *extends* [`AnySchema`](#anyschema) | - |
1296
- | `THeaders` *extends* \| `StandardSchemaV1`\<`Record`\<`string`, `unknown`\>, `Record`\<`string`, `unknown`\>\> \| `undefined` | `undefined` |
1314
+ | `THeaders` *extends* \| `StandardSchemaV1`&lt;`Record`&lt;`string`, `unknown`&gt;, `Record`&lt;`string`, `unknown`&gt;&gt; \| `undefined` | `undefined` |
1297
1315
 
1298
1316
  #### Parameters
1299
1317
 
@@ -1307,7 +1325,7 @@ The schemas are used for automatic validation when publishing or consuming messa
1307
1325
 
1308
1326
  #### Returns
1309
1327
 
1310
- [`MessageDefinition`](#messagedefinition)\<`TPayload`, `THeaders`\>
1328
+ [`MessageDefinition`](#messagedefinition)&lt;`TPayload`, `THeaders`&gt;
1311
1329
 
1312
1330
  A message definition with inferred types
1313
1331
 
@@ -1343,7 +1361,7 @@ function defineQueue(name, options?):
1343
1361
  | QueueWithTtlBackoffInfrastructure;
1344
1362
  ```
1345
1363
 
1346
- Defined in: [builder.ts:198](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L198)
1364
+ Defined in: [builder/queue.ts:180](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/queue.ts#L180)
1347
1365
 
1348
1366
  Define an AMQP queue.
1349
1367
 
@@ -1418,7 +1436,7 @@ const orderQueue = defineQueue('order-processing', {
1418
1436
  function defineTtlBackoffRetryInfrastructure(queueEntry, options?): TtlBackoffRetryInfrastructure;
1419
1437
  ```
1420
1438
 
1421
- Defined in: [builder.ts:1826](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L1826)
1439
+ Defined in: [builder/ttl-backoff.ts:76](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/ttl-backoff.ts#L76)
1422
1440
 
1423
1441
  Create TTL-backoff retry infrastructure for a queue.
1424
1442
 
@@ -1490,7 +1508,7 @@ const contract = defineContract({
1490
1508
  function extractQueue(entry): QueueDefinition;
1491
1509
  ```
1492
1510
 
1493
- Defined in: [builder.ts:939](https://github.com/btravers/amqp-contract/blob/ed05e43c04fa526b751d45622ccc1ac53b2e96f9/packages/contract/src/builder.ts#L939)
1511
+ Defined in: [builder/queue.ts:62](https://github.com/btravers/amqp-contract/blob/c50b9d5f661ce899d34d7eebcfafa47844bd1087/packages/contract/src/builder/queue.ts#L62)
1494
1512
 
1495
1513
  Extract the plain QueueDefinition from a QueueEntry.
1496
1514
  If the entry is a QueueWithTtlBackoffInfrastructure, returns the inner queue.