vatsal mevada
vatsal mevada

Reputation: 5616

root cause behing following kafka exception

We have recently encountered following exception on one of the environment:

java.lang.NullPointerException
    at org.apache.kafka.clients.producer.internals.DefaultPartitioner.partition(DefaultPartitioner.java:70)
    at org.apache.kafka.clients.producer.KafkaProducer.partition(KafkaProducer.java:721)
    at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:459)
    at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:430)

What could be possible root cause behind such exception?

Looking at the source code following method is returning null values for partitions: org.apache.kafka.common.Cluster#partitionsForTopic

Upvotes: 0

Views: 313

Answers (1)

Michal Borowiecki
Michal Borowiecki

Reputation: 4314

You may have been hit by this defect: https://issues.apache.org/jira/browse/KAFKA-3562

Even if the root cause is different, some race condition between partition assignment and metadata fetch, still that fix may help, so I suggest updating. 0.10.0.0 is quite old by now and later versions are a lot more stable.

Upvotes: 1

Related Questions