[ 
https://issues.apache.org/jira/browse/KAFKA-21236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chang Chi Hsu reassigned KAFKA-21236:
-------------------------------------

    Assignee: Chang Chi Hsu  (was: Chia-Ping Tsai)

> DefaultMessageFormatter should not pass the null literal to deserializers for 
> null key/value
> --------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-21236
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21236
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Chia-Ping Tsai
>            Assignee: Chang Chi Hsu
>            Priority: Minor
>
>     private byte[] deserialize(ConsumerRecord<byte[], byte[]> consumerRecord, 
> Optional<Deserializer<?>> deserializer, byte[] sourceBytes, String topic) {
>         byte[] nonNullBytes = sourceBytes != null ? sourceBytes : nullLiteral;
>         return deserializer.map(value -> utfBytes(value.deserialize(topic, 
> consumerRecord.headers(), nonNullBytes).toString())).orElse(nonNullBytes);
>     }
> It looks like only the official StringDeserializer is safe from this logic. I 
> guess we should just skip the deserializer and return nullLiteral instead.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to