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
String-valued headers are now mapped as raw strings by default instead
of being encoded as JSON strings.
This can be disabled until all applications have been upgraded to use
2.3 or later.
* Fix use of `encodeStrings`; remove bogus `SuppressWarnings`.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/kafka.adoc
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3221,6 +3221,14 @@ The `DefaultKafkaHeaderMapper` has a method called `addToStringClasses()` that l
3221
3221
During inbound mapping, they are mapped as `String`.
3222
3222
By default, only `org.springframework.util.MimeType` and `org.springframework.http.MediaType` are mapped this way.
3223
3223
3224
+
NOTE: Starting with version 2.3, handling of String-valued headers is simplified.
3225
+
Such headers are no longer JSON encoded, by default (i.e. they do not have enclosing `"..."` added).
3226
+
The type is still added to the JSON_TYPES header so the receiving system can convert back to a String (from `byte[]`).
3227
+
The mapper can handle (decode) headers produced by older versions (it checks for a leading `"`); in this way an application using 2.3 can consume records from older versions.
3228
+
3229
+
IMPORTANT: To be compatible with earlier versions, set `encodeStrings` to `true`, if records produced by a version using 2.3 might be consumed by applications using earlier versions.
3230
+
When all applications are using 2.3 or higher, you can leave the property at its default value of `false`.
3231
+
3224
3232
[[tombstones]]
3225
3233
==== Null Payloads and Log Compaction of 'Tombstone' Records
0 commit comments