kirktrue commented on pull request #10951: URL: https://github.com/apache/kafka/pull/10951#issuecomment-887627439
Thanks @cmccabe for looking at this! > If I understand correctly, the PR makes up a fake partition so that `TopicPartition` can be non-null in the callback. I don't think that this is the right thing to do. Yeah, I'm not crazy about it either. There was some "prior art" in the codebase where the same thing was done (`ProducerInterceptors.onSendError`) and the existence of `RecordMetadata.UNKNOWN_PARTITION` suggested that it might be permissible for these kinds of cases. > Why not change the JavaDoc for the callback to indicate that `TopicPartition` can be null if the method fails before it gets assigned? My interpretation was that was akin to changing the interface of the `Callback` API and could cause some `NullPointerException` cases in users' code. I'm happy to make the change to the JavaDoc, as suggested. Thanks! -- 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