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


##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -2525,42 +2522,10 @@ class KafkaApis(val requestChannel: RequestChannel,
         new AlterConfigsRequest(remaining, request.header.apiVersion()),
         response => sendResponse(response.map(_.data())))
     } else {
-      sendResponse(Some(processLegacyAlterConfigsRequest(request, remaining)))
+      throw KafkaApis.shouldAlwaysForward(request)

Review Comment:
   `metadataSupport.canForward()` is always true in kraft and request does not 
have `envelope` in kraft broker. Hence, it would be better to simplify the code 
by removing the unnecessary path. for example:
   ```java
       if (remaining.resources().isEmpty) {
         sendResponse(Some(new AlterConfigsResponseData()))
       } else {
         metadataSupport.forwardingManager.get.forwardRequest(request,
           new AlterConfigsRequest(remaining, request.header.apiVersion()),
           response => sendResponse(response.map(_.data())))
       }
   ```
   BTW, I file https://issues.apache.org/jira/browse/KAFKA-18472 to cleanup 
`metadataSupport` 



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