Skip to content

Commit 1f4ac71

Browse files
committed
Rework enum usage; other refactoring; add getters to HeaderNames.
1 parent e5f9c1c commit 1f4ac71

File tree

4 files changed

+227
-100
lines changed

4 files changed

+227
-100
lines changed

spring-kafka-docs/src/main/asciidoc/kafka.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5737,19 +5737,18 @@ The reason for the two properties is because, while you might want to retain onl
57375737
`appendOriginalHeaders` is applied to all headers named `*ORIGINAL*` while `stripPreviousExceptionHeaders` is applied to all headers named `*EXCEPTION*`.
57385738

57395739
Starting with version 2.8.4, you now can control which of the standard headers will be added to the output record.
5740+
See the `enum HeadersToAdd` for the names of the (currently) 10 standard headers that are added by default.
57405741

5741-
There is a new property `whichHeaders`, which is a `BitSet`; for example, to suppress the addition of adding the stack trace header, use the following:
5742+
To exclude headers, use the `excludeHeaders()` method; for example, to suppress adding the exception stack trace in a header, use:
57425743

57435744
====
57445745
[source, java]
57455746
----
57465747
DeadLetterPublishingRecoverer recoverer = new DeadLetterPublishingRecoverer(template);
5747-
recoverer.getWhichHeaders().clear(HeaderNames.HeadersToAdd.EX_STACKTRACE.getBit());
5748+
recoverer.excludeHeaders(HeaderNames.HeadersToAdd.EX_STACKTRACE);
57485749
----
57495750
====
57505751

5751-
See the `enum HeadersToAdd` for the bit names of the (currently) 10 standard headers that are added by default.
5752-
57535752
In addition, you can completely customize the addition of exception headers by adding an `ExceptionHeadersCreator`; this also disables all standard exception headers.
57545753

57555754
====

0 commit comments

Comments
 (0)