Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-17994

Checked exceptions are not handled when deserializing kafka stream record

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.9.0
    • 3.9.1, 4.0.0
    • streams
    • None

    Description

      When we got a PR to upgrade kafka clients 3.8.1 -> 3.9.0, we saw some failing tests. They were relating to using a DeserializationExceptionHandler with 'log and continue' strategy, however on newest version the stream was just crashing when Jackson was trying to deserialize a faulty json and this handler was not invoked.

      In this KIP-1033, specifically in this PR https://github.com/apache/kafka/pull/16745/files#diff-77791b213bb41d1df63a23860f1faf4394dfbd7d6c4ed9cd021950d82c31c24f a change was introduced to catch only RuntimeException type and handle them in the handler. However, all the Jackson exceptions inherit Exception type, not RuntimeException - https://fasterxml.github.io/jackson-core/javadoc/2.14/com/fasterxml/jackson/core/JacksonException.html

      So with this change all the Jackson exceptions (or any checked exceptions) would not be passed to the DeserializationExceptionHandler like it was before.

       

      Attachments

        Issue Links

          Activity

            People

              mjsax Matthias J. Sax
              ilyanerd Ilya
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: