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/11 00:40:52 UTC

[GitHub] [kafka] soceanainn commented on pull request #11482: KAFKA-13448: Align behaviour for producer callbacks with documented behaviour

soceanainn commented on pull request #11482:
URL: https://github.com/apache/kafka/pull/11482#issuecomment-965889575


   @junrao thanks, I'll try to create a KIP tomorrow.
   
   I've added a test for the ApiException case, however for the other case (using `InterceptorCallback`), I can't find a way to test it from the KafkaProducer class.
   
   It's easier to test from the 'ProducerBatch' side of things, but this leads to complications since it is testing that metadata is correctly set to null (e.g. [here](
   https://github.com/apache/kafka/blob/trunk/clients/src/test/java/org/apache/kafka/clients/producer/internals/ProducerBatchTest.java#L125)).
   
   The easiest fix is to make InterceptorCallback accessible at the package level, and update the ProducerBatch method to accept InterceptorCallback as input instead of Callback. That way it would make this implicit conversion from null metadata to an 'empty' record more obvious, and allow us to write proper unit tests around this. What do you think?


-- 
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