Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.7.0, 3.8.0, 3.7.1
-
None
Description
if the metric.reporters property contains some invalid class, the KafkaProducer constructor fails with non explicit NPE:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.Optional.ifPresent(java.util.function.Consumer)" because "this.clientTelemetryReporter" is null at org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:1424) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:472) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:295) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:322) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:307) at org.frouleau.kafka.clients.Produce.sendAvroSpecific(Produce.java:89) at org.frouleau.kafka.clients.Produce.main(Produce.java:63)
This behavior was introduced by KAFKA-15901 implementing KIP-714.
Attachments
Issue Links
- links to