rreddy-22 commented on code in PR #19714: URL: https://github.com/apache/kafka/pull/19714#discussion_r2112812088
########## clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java: ########## @@ -884,6 +884,40 @@ public void abortTransaction() throws ProducerFencedException { producerMetrics.recordAbortTxn(time.nanoseconds() - abortStart); } + /** + * Completes a prepared transaction by comparing the provided prepared transaction state with the + * current prepared state on the producer. + * If they match, the transaction is committed; otherwise, it is aborted. + * + * @param preparedTxnState The prepared transaction state to compare against the current state + * @throws IllegalStateException if the producer is not in prepared transaction state Review Comment: Ah my bad, I didn't change the Javadoc, illegalState. From my understanding, IllegalStateException is used when the producer is in an incorrect state and cannot use the API? InvalidTxnStateException is used for when the transaction is in the wrong state. -- 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