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

NullPointerException if batch.size=0 for producer config

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.10.2.0
    • Fix Version/s: 0.10.2.0
    • Component/s: clients
    • Labels:
      None
    • Environment:
      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 Moczarski

          Issue Links

            Activity

              People

              • Assignee:
                hachikuji Jason Gustafson
                Reporter:
                moczarski Swen Moczarski
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: