ijuma commented on code in PR #12365: URL: https://github.com/apache/kafka/pull/12365#discussion_r922782058
########## clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java: ########## @@ -1491,20 +1495,25 @@ public void setPartition(int partition) { if (log.isTraceEnabled()) { // Log the message here, because we don't know the partition before that. - log.trace("Attempting to append record {} with callback {} to topic {} partition {}", record, userCallback, record.topic(), partition); + log.trace("Attempting to append record {} with callback {} to topic {} partition {}", record, userCallback, topic, partition); } + + // Reset record to null here so that it doesn't have to be alive as long as the batch is. + record = null; Review Comment: We can add another callback method since this is an internal interface, right? This kind of thing leads to a lot of maintenance pain down the line. -- 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