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: src/reference/asciidoc/kafka.adoc
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4868,6 +4868,12 @@ The record sent to the dead-letter topic is enhanced with the following headers:
4868
4868
* `KafkaHeaders.DLT_ORIGINAL_TIMESTAMP`: The original timestamp.
4869
4869
* `KafkaHeaders.DLT_ORIGINAL_TIMESTAMP_TYPE`: The original timestamp type.
4870
4870
4871
+
There are two mechanisms to add more headers.
4872
+
4873
+
1. Subclass the recoverer and override `createProducerRecord()` - call `super.createProducerRecord()` and add more headers.
4874
+
2. Provide a `BiFunction` to receive the consumer record and exception, returning a `Headers` object; headers from there will be copied to the final producer record.
4875
+
4876
+
The second is simpler to implement but the first has more information, including the already assembled standard headers.
4871
4877
4872
4878
Starting with version 2.3, when used in conjunction with an `ErrorHandlingDeserializer`, the publisher will restore the record `value()`, in the dead-letter producer record, to the original value that failed to be deserialized.
4873
4879
Previously, the `value()` was null and user code had to decode the `DeserializationException` from the message headers.
@@ -4903,7 +4909,7 @@ By default, these headers are not retained in the message published to the dead
4903
4909
In that case, the `DLT_*` headers are based on the value deserialization and the key `DeserializationException` is retained in the header.
4904
4910
4905
4911
[[kerberos]]
4906
-
==== Kerberos
4912
+
==== JAAS and Kerberos
4907
4913
4908
4914
Starting with version 2.0, a `KafkaJaasLoginModuleInitializer` class has been added to assist with Kerberos configuration.
4909
4915
You can add this bean, with the desired configuration, to your application context.
0 commit comments