[ 
https://issues.apache.org/jira/browse/KAFKA-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16484144#comment-16484144
 ] 

Viktor Somogyi commented on KAFKA-6923:
---------------------------------------

[~ijuma] have you started working on this? I've been wondering if I might pick 
this up if you don't mind.
What compatibility implications were you referring to?

I've been looking at this and if I'm right then this shouldn't be such a 
relatively small KIP & change.
What I was thinking is that we could:
# define the default method in {{Deserializer}}:
{code}
    default T deserialize(String topic, Headers headers, byte[] data) {
        return deserialize(topic, data);
    }
{code}
Doing this in {{Deserializer}} wouldn't break compatibility as 
{{ExtendedSerializer}} would remain the same and it is allowed (and it seems to 
have the same signature looking at it with javap)
# deprecate {{ExtendedDeserializer}} and {{Wrapper}} saying that new and 
existing implementations should use {{Deserializer}}
# leave {{ExtendedDeserializer}} as is, so existing behavior won't change.
# get rid of the internal usages of {{ExtendedSerializer}} & 
{{Wrapper.ensureExtended()}}
# do the same for {{Serializer}}/{{ExtendedSerializer}}

Is there anything else to this that you were thinking of?

> Consolidate ExtendedSerializer/Serializer and 
> ExtendedDeserializer/Deserializer
> -------------------------------------------------------------------------------
>
>                 Key: KAFKA-6923
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6923
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>            Reporter: Ismael Juma
>            Priority: Major
>              Labels: needs-kip
>             Fix For: 2.1.0
>
>
> The Javadoc of ExtendedDeserializer states:
> {code}
>  * Prefer {@link Deserializer} if access to the headers is not required. Once 
> Kafka drops support for Java 7, the
>  * {@code deserialize()} method introduced by this interface will be added to 
> Deserializer with a default implementation
>  * so that backwards compatibility is maintained. This interface may be 
> deprecated once that happens.
> {code}
> Since we have dropped Java 7 support, we should figure out how to do this. 
> There are compatibility implications, so a KIP is needed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to