m1a2st commented on code in PR #23665:
URL: https://github.com/apache/kafka/pull/23665#discussion_r4314737708


##########
clients/src/main/java/org/apache/kafka/common/requests/RequestHeader.java:
##########
@@ -137,11 +137,27 @@ public ResponseHeader toResponseHeader() {
         return new ResponseHeader(data.correlationId(), 
apiKey().responseHeaderVersion(apiVersion()));

Review Comment:
   In practice, only `ApiVersionsRequest` can reach `toResponseHeader()` with 
an unsupported version. For other APIs, `Processor#parseRequestHeader` rejects 
unsupported versions with `UnsupportedVersionException`, and 
`RequestContext#parseRequest` also throws in this case.
   
   For `ApiVersions`, `responseHeaderVersion()` is hard-coded to return `0` for 
all versions (KIP-511), so the response header version is always well-defined.



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