You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/08 21:34:43 UTC

[GitHub] [kafka] junrao commented on a change in pull request #11470: MINOR: Update docs for producer callbacks to reflect current behaviour

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



##########
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:
       It seems that the fix in https://github.com/apache/kafka/pull/5798 was incorrect. The changes for the comment were intended for InterceptorCallback.onComplete. For Callback.onCompletion, currently, if there is an exception, it seems that metadata will always be null.
   
   For now, we could probably just revert the comment on Callback.onCompletion. 
   
   It's probably useful to make the behavior consistent between Callback.onCompletion and InterceptorCallback.onComplete. We could file a jira to track that since it probably needs a KIP.




-- 
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-unsubscribe@kafka.apache.org

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