Skip to content

Commit 90b6108

Browse files
authored
Add an example of enrichment prior to sending to DLQ (#207)
1 parent ae234fd commit 90b6108

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

modules/configuration/pages/error_handling.adoc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ output:
172172
- resource: processor_2 # Only errored messages, or delivery failures to processor_1, go here
173173
----
174174

175-
Finally, in cases where you want to route data differently depending on the type of error message, you can use a xref:components:outputs/switch.adoc[`switch` output]:
175+
If you want to route data differently based on the type of error message, you can use a xref:components:outputs/switch.adoc[`switch` output]:
176176

177177
[source,yaml]
178178
----
@@ -194,4 +194,18 @@ output:
194194
resource: processor_3
195195
----
196196

197-
// end::single-source[]
197+
Finally, you can attach additional metadata when routing messages to the dead-letter queue, such as the error message. This can be done by running a series of xref:components:processors/about.adoc[processors] before sending the data to the final xref:components:outputs/about.adoc[output].
198+
199+
[source,yaml]
200+
----
201+
output:
202+
fallback:
203+
- reject_errored:
204+
resource: processor_1 # Only non-errored messages go here
205+
- processors:
206+
- mutation: |
207+
root.error = @fallback_error # Adds the error message before sending the message to the dead-letter queue output
208+
resource: processor_2 # Only errored messages, or delivery failures to processor_1, go here
209+
----
210+
211+
// end::single-source[]

0 commit comments

Comments
 (0)