You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,6 +222,15 @@ Under the [examples](examples) - [with-sasl-plaintext](examples/with-sasl-plaint
222
222
of a consumer integration with SASL/PLAIN mechanism. To try the example, you can run the command `docker compose up`
223
223
under [the specified folder](examples/with-sasl-plaintext) and then start the application.
224
224
225
+
#### With Send Direct To Dead Letter
226
+
227
+
This feature lets you send a message directly to a dead-letter topic by setting `message.SendDirectToDeadLetter = true` inside your `ConsumeFn` (or selectively for items in `BatchConsumeFn`). When this flag is set and your `ConsumeFn` returns an error, the message is produced to the configured dead-letter topic with an `x-error-message` header.
228
+
229
+
- Dead letter topic resolution order: if `consumer.DeadLetterTopic` is set, it is used; otherwise `retryConfiguration.deadLetterTopic` is used.
230
+
- You can set `message.ErrDescription` to override the error header value written as `x-error-message`.
231
+
232
+
Please refer to [Send Direct To Dead Letter Example](examples/with-send-direct-to-deadletter) to run both single and batch scenarios.
233
+
225
234
## Configurations
226
235
227
236
| config | description | default |
@@ -233,6 +242,7 @@ under [the specified folder](examples/with-sasl-plaintext) and then start the ap
233
242
|`concurrency`| Number of goroutines used at listeners | 1 |
234
243
|`retryEnabled`| Retry/Exception consumer is working or not | false |
235
244
|`transactionalRetry`| Set false if you want to use exception/retry strategy to only failed messages | true |
245
+
|`deadLetterTopic`| Dead-letter topic name to produce messages when `message.SendDirectToDeadLetter` is true. If empty, `retryConfiguration.deadLetterTopic` will be used. | "" |
236
246
|`commitInterval`| indicates the interval at which offsets are committed to the broker. | 1s |
|`retryConfiguration.deadLetterTopic`| Dead-letter topic name used by the retry/exception pipeline; also used as a fallback for direct dead-lettering when top-level `deadLetterTopic` is empty. ||
0 commit comments