jolshan commented on code in PR #16840:
URL: https://github.com/apache/kafka/pull/16840#discussion_r1711908272
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -980,6 +998,49 @@ void handleCoordinatorReady() {
null;
this.coordinatorSupportsBumpingEpoch = initProducerIdVersion != null &&
initProducerIdVersion.maxVersion() >= 3;
+
+ if (nodeApiVersions == null) return;
+
+ if (nodeApiVersions.supportedFeatures() != null) {
+ /*
+ To enable the transaction V2, it requires:
+ 1. transaction.version max version >= 2
+ 2. The ProduceRequest max version >
ProducerRequest.LAST_BEFORE_TRANSACTION_V2_VERSION
+ 3. The TxnOffsetCommitRequest max version >
TxnOffsetCommitRequest.LAST_BEFORE_TRANSACTION_V2_VERSION
+ */
+ ApiVersion produceVersion =
nodeApiVersions.apiVersion(ApiKeys.PRODUCE);
+ ApiVersion txnOffsetCommitVersion =
nodeApiVersions.apiVersion(ApiKeys.TXN_OFFSET_COMMIT);
+ SupportedVersionRange transactionVersion =
nodeApiVersions.supportedFeatures().get("transaction.version");
Review Comment:
This should be finalizedFeatures.
--
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]