CalvinConfluent commented on code in PR #16840:
URL: https://github.com/apache/kafka/pull/16840#discussion_r1720148521


##########
clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java:
##########
@@ -53,11 +54,15 @@ public static Builder forMagic(byte magic, 
ProduceRequestData data) {
             maxVersion = 2;
         } else {
             minVersion = 3;
-            maxVersion = ApiKeys.PRODUCE.latestVersion();
+            maxVersion = latestVersion;
         }
         return new Builder(minVersion, maxVersion, data);
     }
 
+    public static Builder forMagic(byte magic, ProduceRequestData data) {

Review Comment:
   I guess forMagic is for compatibility issues back in 2017. I update the code 
here to let the caller assign the desired produce request version.



-- 
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]

Reply via email to