soceanainn commented on a change in pull request #11470:
URL: https://github.com/apache/kafka/pull/11470#discussion_r745122437



##########
File path: clients/src/main/java/org/apache/kafka/clients/producer/Callback.java
##########
@@ -25,10 +25,12 @@
     /**
      * A callback method the user can implement to provide asynchronous 
handling of request completion. This method will
      * be called when the record sent to the server has been acknowledged. 
When exception is not null in the callback,
-     * metadata will contain the special -1 value for all fields except for 
topicPartition, which will be valid.
+     * and the exception is a subclass of ApiException, metadata will be null. 
For all other exceptions, metadata will

Review comment:
       I don't think metadata will always be null, as the updated metadata will 
sometimes be passed to the user callback as far as I can see from the 
InterceptorCallback implementation (see 
[here](https://github.com/apache/kafka/blob/3.1/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L1387-L1390)).
   
   I believe we have been seeing a mixture of null metadata + placeholder 
metadata in our Kafka deployment (v2.3.1), which has caused some issues for my 
team.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to