tombentley commented on code in PR #12264:
URL: https://github.com/apache/kafka/pull/12264#discussion_r892246131
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -754,11 +754,16 @@ public void sendOffsetsToTransaction(Map<TopicPartition,
OffsetAndMetadata> offs
/**
* Commits the ongoing transaction. This method will flush any unsent
records before actually committing the transaction.
- *
+ * <p>
* Further, if any of the {@link #send(ProducerRecord)} calls which were
part of the transaction hit irrecoverable
* errors, this method will throw the last received exception immediately
and the transaction will not be committed.
* So all {@link #send(ProducerRecord)} calls in a transaction must
succeed in order for this method to succeed.
- *
+ * <p>
+ * If the transaction is committed successfully and this method returns
without throwing an exception, it is guaranteed
+ * that all {@link Callback callbacks} for records in the transaction will
have been invoked and completed, either
+ * successfully or by raising an exception. In the event that a callback
fails (i.e., raises an exception), the producer
+ * will still proceed with the transaction commit.
Review Comment:
```suggestion
* If the transaction is committed successfully and this method returns
without throwing an exception, it is guaranteed
* that all {@link Callback callbacks} for records in the transaction
will have been invoked. Exceptions thrown by
* callbacks are ignored; the producer proceeds to commit the
transaction in any case.
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]