You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2020/08/18 10:30:00 UTC

[jira] [Created] (KAFKA-10412) Deprecate all setters of Headers

Chia-Ping Tsai created KAFKA-10412:
--------------------------------------

             Summary: Deprecate all setters of Headers
                 Key: KAFKA-10412
                 URL: https://issues.apache.org/jira/browse/KAFKA-10412
             Project: Kafka
          Issue Type: Improvement
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai


_Headers is a part of public APIs but the usage of Headers is a bit chaos to users._
 # it has a lot of abstract setters so users have to implement all of them. However, we never call user-defined setters in production.
 # it is not thread-safe so we have to call "setReadOnly" to make data consistency.
 # "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._



--
This message was sent by Atlassian Jira
(v8.3.4#803005)