Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-13842

Improve Logging on KafkaConsumer when KafkaException is Thrown

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • camel-kafka
    • None
    • Novice

    Description

      The Kafka Camel component "hides" the stacktrace of exceptions occurring in the following point. 

      components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
      ...
      log.warn("KafkaException consuming {} from topic {}. Will attempt to re-connect on next run", threadId, topicName);
      reConnect = true;
      ...

      It makes difficult to know the root of the KafkaException exception (NullPointer for example) by seeing the log.

      Maybe change the log.warn to handtleException so we can see the full stack trace in the log, since LoggingExceptionHandler logs the full stack trace.

      ...
      getExceptionHandler().handleException("KafkaException consuming " + threadId + " from topic " + topicName + ". Will attempt to re-connect on next run", e);
      reConnect = true;
      ...

       

      Attachments

        Activity

          People

            ramu11 Ramu
            LeonardoZV Leonardo Vasconcellos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: