You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Congxian Qiu(klion26) (JIRA)" <ji...@apache.org> on 2019/05/05 01:52:00 UTC

[jira] [Commented] (FLINK-12400) NullpointerException using SimpleStringSchema with Kafka

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

Congxian Qiu(klion26) commented on FLINK-12400:
-----------------------------------------------

[~PierreZ] thanks for filing this issue, I think there is already an issue want to fix this, please have a look at https://issues.apache.org/jira/browse/FLINK-11820

> 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.7.2, 1.8.0
>         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
>            Priority: Minor
>
> 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)