rreddy-22 commented on code in PR #19539:
URL: https://github.com/apache/kafka/pull/19539#discussion_r2078915492
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -978,6 +1022,14 @@ private Future<RecordMetadata> doSend(ProducerRecord<K,
V> record, Callback call
try {
throwIfProducerClosed();
+
+ // Check if we're in a prepared transaction state, in which case
send is not allowed
Review Comment:
I originally didn't add the check to the beginTransaction method since we
expect the IllegalStateException when the illegal state transition from
PREPARED to IN_TRANSACTION is attempted. But I can add a preemptive error like
the send method for begin txn as well
--
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]