here is my two cents. In order to keep the BC, SC, and correct deprecation cycle(deprecate Serializer/Deserializer in 2.0), the solution of this issue is to introduce a new class to replace the Serializer and Deserializer. The new class should be a subclass of Serializer/Deserializer and it has the method "byte[] serialize(String topic, Headers headers, T data)". Also, we have to add default implementation of the new method to Serializer/Deserializer for BC and SC, and Serializer/Deserializer should be marked as @deprecated.
The benefits are 1) we can keep the BC and SC in 2.0, 2) the Serializer/Deserializer can be removed in the future without breaking the compatibility rule since we have deprecated them, and 3) the new kafka user can use new Serializer/Deserializer in 2.0 and it still work in 3.0. The side effect is that we have to update all Public APIs and docs referencing to the Serializer/Deserializer. However, IIRC the main usage of Serializer/Deserializer is in Producer/Consume so we can tolerate the pain. On 2018/07/09 08:50:07, Viktor Somogyi <viktorsomo...@gmail.com> wrote: > Hi folks, > > I've published KIP-336 which is about consolidating the > Serializer/Deserializer interfaces. > > Basically the story here is when ExtendedSerializer and > ExtendedDeserializer were added we still supported Java 7 and therefore had > to use compatible constructs which now seem unnecessary since we dropped > support for Java 7. Now in this KIP I propose a way to deprecate those > patterns: > https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=87298242 > > I'd be happy to receive some feedback about the KIP I published. > > Cheers, > Viktor >