jolshan commented on code in PR #16840:
URL: https://github.com/apache/kafka/pull/16840#discussion_r1719109197
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -368,15 +369,21 @@ public synchronized TransactionalRequestResult
sendOffsetsToTransaction(final Ma
"(currentState= " + currentState + ")");
}
- log.debug("Begin adding offsets {} for consumer group {} to
transaction", offsets, groupMetadata);
- AddOffsetsToTxnRequest.Builder builder = new
AddOffsetsToTxnRequest.Builder(
- new AddOffsetsToTxnRequestData()
- .setTransactionalId(transactionalId)
- .setProducerId(producerIdAndEpoch.producerId)
- .setProducerEpoch(producerIdAndEpoch.epoch)
- .setGroupId(groupMetadata.groupId())
- );
- AddOffsetsToTxnHandler handler = new AddOffsetsToTxnHandler(builder,
offsets, groupMetadata);
+ TxnRequestHandler handler;
+ if (coordinatorSupportsTransactionV2) {
+ log.debug("Begin adding offsets {} for consumer group {} to
transaction with transaction protocol V2", offsets, groupMetadata);
+ handler = txnOffsetCommitHandler(null, offsets, groupMetadata,
Short.MAX_VALUE);
Review Comment:
Do we want to say max value here? or just the current max value for the api?
--
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]