Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.2.0
-
None
-
Unknown
Description
Hello everyone,
I found out i few days ago that if a `SerializationException` is thrown when the consumer tries to poll messages, it will keep leaving and joining the consumer-group indefinitely and without any informative log.
The exception cannot either be handled by any camel exception handler.
After some searching in the code i found out the culprit:
// org.apache.camel.component.kafka.KafkaConsumer (ligns 406-415): catch (KafkaException e) { // some kind of error in kafka, it may happen during // unsubscribing or during normal processing if (unsubscribing){ getExceptionHandler().handleException("Error unsubscribing " + threadId + " from kafka topic " + topicName, e); }else { LOG.debug("KafkaException consuming {} from topic {} causedby {}. Will attempt to re-connect on next run", threadId, topicName, e.getMessage()); reConnect = true; } }
`SerializationException` extends from `KafkaException`, but it is definitely not a recoverable exception.
It logs with debug level, which makes it hard to track, there are SO many things logging in debug.
It it cannot be handled by any camel exception handling mechanism.
I think it would be better to either:
- change that catch so that it pinpoints the subclasses of `KafkaException` that are actually recoverable from rejoining (maybe `WakeupException` and a couple others)
- add a `catch` block for `SerializationException` and maybe `ConfigException` and `OAuthBearerConfigException` before, with a log error andallow the user to handle those exceptions
- remove that catch block entirely and let users handle any KafkaException however they see fit.
Thank you
Attachments
Attachments
Issue Links
- links to