Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-2578

Kafka source throws NPE if Kafka record has null key

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: None
    • Labels:
      None

      Description

      When the Kafka topics contain messages with no key (such as the messages sent by default from kafka-console-producer), Kafka Source throws NPE:

      2014-12-20 12:58:59,604 ERROR
      org.apache.flume.source.kafka.KafkaSource: KafkaSource EXCEPTION, {}
      java.lang.NullPointerException
      at java.lang.String.<init>(String.java:556)
      at org.apache.flume.source.kafka.KafkaSource.process(KafkaSource.java:105)
      at org.apache.flume.source.PollableSourceRunner$PollingRunner.run(PollableSourceRunner.java:139)
      at java.lang.Thread.run(Thread.java:745)
      )

        Activity

        Hide
        gwenshap Gwen Shapira added a comment -

        simple fix + test

        Show
        gwenshap Gwen Shapira added a comment - simple fix + test
        Hide
        skeltoac Andy Skelton added a comment -

        The patch fixes the NPE for me. Thanks, Gwen Shapira!

        Show
        skeltoac Andy Skelton added a comment - The patch fixes the NPE for me. Thanks, Gwen Shapira !
        Hide
        gwenshap Gwen Shapira added a comment -

        Thanks Andy Skelton!

        Hari Shreedharan - come on, review this one already

        Show
        gwenshap Gwen Shapira added a comment - Thanks Andy Skelton ! Hari Shreedharan - come on, review this one already
        Hide
        hshreedharan Hari Shreedharan added a comment -

        Gwen Shapira - Done!

        +1. Running tests and committing!

        Show
        hshreedharan Hari Shreedharan added a comment - Gwen Shapira - Done! +1. Running tests and committing!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 199684b62ec983b8f922b1d6d706479032a18e64 in flume's branch refs/heads/trunk from Hari Shreedharan
        [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=199684b ]

        FLUME-2578. Kafka source throws NPE if Kafka record has null key

        (Gwen Shapira via Hari)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 199684b62ec983b8f922b1d6d706479032a18e64 in flume's branch refs/heads/trunk from Hari Shreedharan [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=199684b ] FLUME-2578 . Kafka source throws NPE if Kafka record has null key (Gwen Shapira via Hari)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 70ba4a97f11d8afd0f1d3f1eb31f7958ca808f29 in flume's branch refs/heads/flume-1.6 from Hari Shreedharan
        [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=70ba4a9 ]

        FLUME-2578. Kafka source throws NPE if Kafka record has null key

        (Gwen Shapira via Hari)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 70ba4a97f11d8afd0f1d3f1eb31f7958ca808f29 in flume's branch refs/heads/flume-1.6 from Hari Shreedharan [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=70ba4a9 ] FLUME-2578 . Kafka source throws NPE if Kafka record has null key (Gwen Shapira via Hari)
        Hide
        hshreedharan Hari Shreedharan added a comment -

        Committed! Thanks Gwen!

        Show
        hshreedharan Hari Shreedharan added a comment - Committed! Thanks Gwen!
        Hide
        hudson Hudson added a comment -

        UNSTABLE: Integrated in flume-trunk #706 (See https://builds.apache.org/job/flume-trunk/706/)
        FLUME-2578. Kafka source throws NPE if Kafka record has null key (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=199684b62ec983b8f922b1d6d706479032a18e64)

        • flume-ng-sources/flume-kafka-source/src/test/java/org/apache/flume/source/kafka/TestKafkaSource.java
        • flume-ng-sources/flume-kafka-source/src/main/java/org/apache/flume/source/kafka/KafkaSource.java
        Show
        hudson Hudson added a comment - UNSTABLE: Integrated in flume-trunk #706 (See https://builds.apache.org/job/flume-trunk/706/ ) FLUME-2578 . Kafka source throws NPE if Kafka record has null key (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=199684b62ec983b8f922b1d6d706479032a18e64 ) flume-ng-sources/flume-kafka-source/src/test/java/org/apache/flume/source/kafka/TestKafkaSource.java flume-ng-sources/flume-kafka-source/src/main/java/org/apache/flume/source/kafka/KafkaSource.java
        Hide
        hudson Hudson added a comment -

        UNSTABLE: Integrated in Flume-trunk-hbase-98 #63 (See https://builds.apache.org/job/Flume-trunk-hbase-98/63/)
        FLUME-2578. Kafka source throws NPE if Kafka record has null key (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=199684b62ec983b8f922b1d6d706479032a18e64)

        • flume-ng-sources/flume-kafka-source/src/test/java/org/apache/flume/source/kafka/TestKafkaSource.java
        • flume-ng-sources/flume-kafka-source/src/main/java/org/apache/flume/source/kafka/KafkaSource.java
        Show
        hudson Hudson added a comment - UNSTABLE: Integrated in Flume-trunk-hbase-98 #63 (See https://builds.apache.org/job/Flume-trunk-hbase-98/63/ ) FLUME-2578 . Kafka source throws NPE if Kafka record has null key (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=199684b62ec983b8f922b1d6d706479032a18e64 ) flume-ng-sources/flume-kafka-source/src/test/java/org/apache/flume/source/kafka/TestKafkaSource.java flume-ng-sources/flume-kafka-source/src/main/java/org/apache/flume/source/kafka/KafkaSource.java

          People

          • Assignee:
            gwenshap Gwen Shapira
            Reporter:
            gwenshap Gwen Shapira
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development