Pierre Zemb created FLINK-12400:
-----------------------------------

             Summary: NullpointerException using SimpleStringSchema with Kafka
                 Key: FLINK-12400
                 URL: https://issues.apache.org/jira/browse/FLINK-12400
             Project: Flink
          Issue Type: Improvement
          Components: API / Type Serialization System
    Affects Versions: 1.8.0, 1.7.2
         Environment: Flink 1.7.2 job on 1.8 cluster
Kafka 0.10 with a topic in log-compaction
            Reporter: Pierre Zemb
            Assignee: Pierre Zemb


Hi!

Yesterday, we saw a strange behavior with our Flink job and Kafka. We are 
consuming a Kafka topic setup in 
[log-compaction|https://kafka.apache.org/documentation/#compaction] mode. As 
such, sending a message with a null payload acts like a tombstone.

We are consuming Kafka like this:

{code:java}
new FlinkKafkaConsumer010<>  ("topic", new SimpleStringSchema(), 
this.kafkaProperties)
{code}

When we sent the message, job failed because of a NullPointerException 
[here|https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/common/serialization/SimpleStringSchema.java#L75].
 `byte[] message` was null, causing the NPE. 

We forked the class and added a basic nullable check, returning null if so. It 
fixed our issue. 

Should we add it to the main class?



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

Reply via email to