Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4761

NullPointerException if batch.size=0 for producer config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 0.10.2.0
    • 0.10.2.0
    • clients
    • None
    • jdk1.8.0_40

    Description

      When setting batch.size to 0 for producer I get the following exception when sending a record:

      java.lang.NullPointerException
      	at org.apache.kafka.common.utils.Utils.notNull(Utils.java:315)
      	at org.apache.kafka.clients.producer.internals.RecordAccumulator.append(RecordAccumulator.java:197)
      	at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:478)
      	at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:440)
      	at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:360)
      	at KafkaProducerTest.exposeNpeOnBatchSizeZero(KafkaProducerTest.java:21)
      

      But documentation says:

      ... (a batch size of zero will disable batching entirely).

      Please, see attached test.

      Attachments

        1. KafkaProducerTest.java
          0.9 kB
          Swen Fuhrmann

        Issue Links

          Activity

            People

              hachikuji Jason Gustafson
              moczarski Swen Fuhrmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: