-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeadLetterPublishingRecoverer should respect onlyLogRecordMatadata listener property #2268
Comments
Which version are you using? And which log message specifically? It looks like all logs in 2.8.x properly log the record; in 2.7.x, I see one debug and 2 exceptions that log the producer record. |
That flag only controls logging of the consumer record. The DLPR does log the producer record; in 2.8 we added a new feature to format the logs for producer record. spring-kafka/spring-kafka/src/main/java/org/springframework/kafka/support/KafkaUtils.java Lines 168 to 176 in f94620a
The default formatter logs the full record. |
Although it was back-ported to 2.7.x, the DLPR doesn't use it. |
Good point @garyrussell. I'm on 2.7.12. I don't see Line 501 in 85cbbed
Line 525 in 85cbbed
|
It might be useful if |
Yes, I will do some polishing around that at the same time; we don't allow protected fields (except loggers), but I can add a getter for it. |
Resolves spring-projects#2268 2.7.x Only The DLPR was incorrectly logging the full `ProducerRecord`; later versions log the original `ConsumerRecord` using `KafkaUtils.format()`. Backport the logging changes, but use a `ThreadLocal` for the input record to avoid API changes in a patch release.
Resolves #2268 2.7.x Only The DLPR was incorrectly logging the full `ProducerRecord`; later versions log the original `ConsumerRecord` using `KafkaUtils.format()`. Backport the logging changes, but use a `ThreadLocal` for the input record to avoid API changes in a patch release.
Closed by 56b7756 (Not sure why this didn't auto-close). |
Expected Behavior
Currently the
org.springframework.kafka.listener.KafkaMessageListenerContainer
class hasonlyLogRecordMatadata
property that governs howConsumerRecord
is logged on processing failure. SameonlyLogRecordMatadata
property should be respected by theorg.springframework.kafka.listener.DeadLetterPublishingRecoverer
class forProducerRecord
.Current Behavior
DeadLetterPublishingRecoverer
currently logs the wholeProducerRecord
when publication fails with no option to switch to just the metadata.Context
We already have set
onlyLogRecordMatadata = true
because we don't want the message payload to appear in the logs when something fails. SinceDeadLetterPublishingRecoverer
copies the payload from the failed message into aProducerRecord
we still see the original message payload in the logs when publication fails.The text was updated successfully, but these errors were encountered: