Closed neilprosser closed 6 years ago
When the send-then callback is called during an error case, it will be called with nil for the value of metadata (https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L917).
send-then
nil
metadata
This PR adds a bit of defensive code to avoid a NullPointerException and make callbacks work for sends which have gone wrong.
NullPointerException
When the
send-then
callback is called during an error case, it will be called withnil
for the value ofmetadata
(https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L917).This PR adds a bit of defensive code to avoid a
NullPointerException
and make callbacks work for sends which have gone wrong.