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

Deprecate all setters of Headers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Headers is a part of public APIs but the usage of Headers is a bit chaos to users.

      1. it has a lot of abstract setters so users have to implement all of them. However, we never call user-defined setters in production.
      2. it is not thread-safe so we have to call "setReadOnly" to make data consistency.
      3. "setReadOnly" is not a part of public API so users have no idea about the "thread-safe" of Headers

      We can't improve Headers right now by reason of deprecation cycles. This KIP plans to deprecate and offer default implementation (java.lang.UnsupportedOperationException) to all setters of Headers so we can cleanup all setters to make it be readonly in next major and users are able to remove all useless implementation from their Headers in this patch.

      Attachments

        Issue Links

          Activity

            People

              chia7712 Chia-Ping Tsai
              chia7712 Chia-Ping Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: