Description
1.
org.apache.kafka.clients.producer.Callback interface has method onCompletion(...)
Which says as part of the documentation :
The metadata for the record that was sent (i.e. the partition and offset). *An empty metadata with -1 value for all fields except for topicPartition will be returned if an error occurred.
We got an NPE from doSend(...) method in org.apache.kafka.clients.producer.KafkaProducer
Which can occur in case ApiException was thrown ...
In case of ApiException it uses the regular callback instead of InterceptorCallback which also may cover the NPE.
2. More over RecordMetadata has method partition() which return int but can also throw NPE because TopicPartition might be null.
Stack trace attached.
Attachments
Attachments
Issue Links
- is duplicated by
-
KAFKA-13448 Kafka Producer Client Callback behaviour does not align with Javadoc
- Resolved
- links to