@amqp-contract/worker 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,9 +20,8 @@ pnpm add @amqp-contract/worker
20
20
 
21
21
  - ✅ **Type-safe message consumption** — Handlers are fully typed based on your contract
22
22
  - ✅ **Automatic validation** — Messages are validated before reaching your handlers
23
- - ✅ **Automatic retry with exponential backoff** — Built-in retry mechanism using RabbitMQ TTL+DLX pattern
23
+ - ✅ **Automatic retry mechanism** — Built-in immediate or exponential backoff retry mechanisms
24
24
  - ✅ **Prefetch configuration** — Control message flow with per-consumer prefetch settings
25
- - ✅ **Batch processing** — Process multiple messages at once for better throughput
26
25
  - ✅ **Automatic reconnection** — Built-in connection management with failover support
27
26
 
28
27
  ## Usage
@@ -68,16 +67,16 @@ const worker = await TypedAmqpWorker.create({
68
67
 
69
68
  ### Advanced Features
70
69
 
71
- For advanced features like prefetch configuration, batch processing, and **automatic retry with exponential backoff**, see the [Worker Usage Guide](https://btravers.github.io/amqp-contract/guide/worker-usage).
70
+ For advanced features like prefetch configuration and **automatic retry**, see the [Worker Usage Guide](https://btravers.github.io/amqp-contract/guide/worker-usage).
72
71
 
73
- #### Retry with Exponential Backoff
72
+ #### Retry configuration
74
73
 
75
74
  Retry is configured at the queue level in your contract definition. Add `retry` to your queue definition:
76
75
 
77
76
  ```typescript
78
77
  import { defineQueue, defineExchange, defineContract } from "@amqp-contract/contract";
79
78
 
80
- const dlx = defineExchange("orders-dlx", "topic", { durable: true });
79
+ const dlx = defineExchange("orders-dlx");
81
80
 
82
81
  // Configure retry at queue level
83
82
  const orderQueue = defineQueue("order-processing", {
@@ -112,7 +111,7 @@ const worker = await TypedAmqpWorker.create({
112
111
  });
113
112
  ```
114
113
 
115
- The retry mechanism uses RabbitMQ's native TTL and Dead Letter Exchange pattern, so it doesn't block the consumer during retry delays. See the [Error Handling and Retry](https://btravers.github.io/amqp-contract/guide/worker-usage#error-handling-and-retry) section in the guide for complete details.
114
+ See the [Error Handling and Retry](https://btravers.github.io/amqp-contract/guide/worker-usage#error-handling-and-retry) section in the guide for complete details.
116
115
 
117
116
  ## Defining Handlers Externally
118
117
 
@@ -148,7 +147,7 @@ Worker defines error classes:
148
147
  - `TechnicalError` - Runtime failures (parsing, processing)
149
148
  - `MessageValidationError` - Message fails schema validation
150
149
  - `RetryableError` - Signals that the error is transient and should be retried
151
- - `NonRetryableError` - Signals permanent failure, message goes to DLQ
150
+ - `NonRetryableError` - Signals permanent failure, message is sent to DLQ (if configured) or dropped
152
151
 
153
152
  ## API
154
153