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
@BeanpublicDefaultErrorHandlererrorHandler() {
BackOfffixedBackOff = newFixedBackOff(0, 0);
returnnewDefaultErrorHandler(
(consumerRecord, exception) -> log.error("Failed to process message from topic:{}. key:{}",
consumerRecord.topic(), consumerRecord.key(), exception),
fixedBackOff);
}
When we use spring-kafka 3.1.2 logs produced by this handler had MDCs (traceId, spanId and one custom BaggageField). After upgrade to spring-kafka 3.1.3 MDCs are gone.
To Reproduce
Send event that will cause exception handled by errorHandler.
Expected behavior
Logs should have MDCs as before.
Sample
I'm not able to share sample now, hope that description above is enough.
The text was updated successfully, but these errors were encountered:
We will look shortly what can be done.
So, looks like we have to restore the previous logic with a try..catch inside observation.observe(), but at the same time use observation.error() in the catch block.
Fixes: #3151
After fixing #3049 we are missing an `ErrorHandler` part within an observation.
This even cause a retryable topic logic ot be out of an observation scope.
* Restore the previous behavior and add `observation.error(e)` when it is not re-thrown in case of `this.commonErrorHandler` presence
(cherry picked from commit c24575c)
Fixes: #3151
After fixing #3049 we are missing an `ErrorHandler` part within an observation.
This even cause a retryable topic logic ot be out of an observation scope.
* Restore the previous behavior and add `observation.error(e)` when it is not re-thrown in case of `this.commonErrorHandler` presence
(cherry picked from commit c24575c)
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.1.3
In 3.1.2 works fine.
Describe the bug
For ConcurrentKafkaListenerContainerFactory we set CommonErrorHandler that you can see below:
When we use spring-kafka 3.1.2 logs produced by this handler had MDCs (traceId, spanId and one custom BaggageField). After upgrade to spring-kafka 3.1.3 MDCs are gone.
To Reproduce
Send event that will cause exception handled by errorHandler.
Expected behavior
Logs should have MDCs as before.
Sample
I'm not able to share sample now, hope that description above is enough.
The text was updated successfully, but these errors were encountered: