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
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4357,6 +4357,22 @@ The mapper can handle (decode) headers produced by older versions (it checks for
4357
4357
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.
4358
4358
When all applications are using 2.3 or higher, you can leave the property at its default value of `false`.
4359
4359
4360
+
====
4361
+
[source, java]
4362
+
----
4363
+
@Bean
4364
+
MessagingMessageConverter converter() {
4365
+
MessagingMessageConverter converter = new MessagingMessageConverter();
4366
+
DefaultKafkaHeaderMapper mapper = new DefaultKafkaHeaderMapper();
4367
+
mapper.setEncodeStrings(true);
4368
+
converter.setHeaderMapper(mapper);
4369
+
return converter;
4370
+
}
4371
+
----
4372
+
====
4373
+
4374
+
If using Spring Boot, it will auto configure this converter bean into the auto-configured `KafkaTemplate`; otherwise you should add this converter to the template.
4375
+
4360
4376
[[tombstones]]
4361
4377
==== Null Payloads and Log Compaction of 'Tombstone' Records
0 commit comments