Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state: Under Discussion accepted

Vote thread: https://lists.apache.org/thread/jsy1ld5f6b6k8qcjzpy5k08ropqd4dd1

Discussion thread: https://lists.apache.org/thread/n3k6vb4vddl1s5nopcyglnddtvzp4j63

...

Code Block
languagescala
@deprecated(since = "3.8.0")
trait Decoder[T] {
  def fromBytes(bytes: Array[Byte]): T
}


Proposed Changes

  1. Introduce a new java interface org.apache.kafka.tools.api.Decoder to replace scala trait kafka.serializer.Decoder
  2. deprecate all "class names" of kafka.serializer.Decoder implementations. That includes kafka.serializer.DefaultDecoder, kafka.serializer.StringDecoder, kafka.serializer.LongDecoder, and kafka.serializer.IntegerDecoder 
  3. remove the VerifiableProperties from constructor. We "always" pass empty VerifiableProperties before (known issue:
    Jira
    serverASF JIRA
    serverId5aa69414-a9e9-3523-82ec-879b028fb15b
    keyKAFKA-12311
    ), and hence using the VerifiableProperties to create new decoder does not make sense. If users require configurable decoder, we can make decoder extend Configurable in the future.

Compatibility, Deprecation, and Migration Plan

  • before 4.0, users can keep using the deprecated kafka.serializer.Decoder
  • after 4.0, all users need to update is the superclass is changed from kafka.serializer.Decoder to org.apache.kafka.tools.api.Decoder. They have same methods, so users don't need to change any code of method implementationmethod, but the new constructor does not accept VerifiableProperties. Hence, users' custom decoders have to offer default constructor
  • before 4.0, users can access both interfaces by depending on core module.
  • after 4.0, users need to can import tools-api module if instead of core module is gone.

Test Plan

The new unit test used to verify the "warning messages" about deprecated kafka.serializer.Decoder will be added. The messages are used to encourage users to adopt the new interface

...