Swen Moczarski created KAFKA-4761:
-------------------------------------

             Summary: NullPointerException if batch.size=0 for producer config
                 Key: KAFKA-4761
                 URL: https://issues.apache.org/jira/browse/KAFKA-4761
             Project: Kafka
          Issue Type: Bug
          Components: clients
    Affects Versions: 0.10.2.0
         Environment: jdk1.8.0_40
            Reporter: Swen Moczarski
            Priority: Minor
         Attachments: KafkaProducerTest.java

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

{noformat}
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)
{noformat}

But documentation says:
{quote}
 ... (a batch size of zero will disable batching entirely).
{quote}

Please, see attached test.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to