chia7712 commented on code in PR #18727:
URL: https://github.com/apache/kafka/pull/18727#discussion_r1936263117


##########
clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java:
##########
@@ -264,8 +273,11 @@ public boolean hasValidVersion() {
         return oldestVersion() <= latestVersion();
     }
 
-    public Optional<ApiVersionsResponseData.ApiVersion> toApiVersion(boolean 
enableUnstableLastVersion) {
-        short oldestVersion = oldestVersion();
+    public Optional<ApiVersionsResponseData.ApiVersion> toApiVersion(boolean 
enableUnstableLastVersion,
+                                                                     
Optional<ApiMessageType.ListenerType> listenerType) {
+        // see `PRODUCE_MIN_VERSION` for details on why we do this
+        short oldestVersion = (this == PRODUCE && listenerType.map(l -> l == 
ApiMessageType.ListenerType.BROKER).orElse(false)) ?

Review Comment:
   Excuse me, but why change the (produce) schema version after we decided to 
change the API response? I assumed all we needed to do was return the API 
response including v0-v2 produce requests to fix the librdkafka issue.  Then, 
the schema could remain at v3-v12, so the v0-v2 requests would still be 
rejected.



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

Reply via email to