Send Custom Header only to DLT Topic. #2527
Unanswered
wojciechcwek
asked this question in
Q&A
Replies: 1 comment 2 replies
-
In your custom headers function, you can check the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I have added the following logic to add custom header in events that are sent to retry and dlt topics. I use spring-kafa 2.8.8.
Unfortunately the following header is passed to another topic. I'll give you an example: I have 2 retry topics and dlt. The exception is thrown and the header is added at main topic, then at retry-0 I receive the event, where that header already is and then I add it again, because the exception was thrown once again. So at retry-1 I have 2 same headers. It ends in dlt topic, where are 3 headers with the same name. It happens, because "Apache Kafka supports multiple headers with the same name" as it is written here: https://docs.spring.io/spring-kafka/reference/html/#dlpr-headers
I think of two solutions and I'm not sure how to achieve them:
Do you know if the second solution is possible?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions