m1a2st commented on code in PR #23665:
URL: https://github.com/apache/kafka/pull/23665#discussion_r4296023473
##########
clients/src/main/java/org/apache/kafka/common/requests/RequestContext.java:
##########
@@ -109,11 +110,31 @@ public RequestContext(RequestHeader header,
this.principalSerde = principalSerde;
}
+ /**
+ * Parses the request body from the given buffer, which must be positioned
at the start of the request body.
+ * If the header indicates the request version is unsupported, the request
body is not parsed. An unsupported
+ * {@link ApiVersionsRequest} is treated as a v0 request. For other
requests, an UnsupportedVersionException is thrown.
+ * <p>
+ * This allows the broker to handle {@link ApiVersionsRequest} from newer
clients, which uses a request version
+ * unknown to the broker. The broker responds with a v0 {@link
ApiVersionsResponse} in that case, and the client
+ * falls back to parsing the response as v0 if it cannot parse it as the
expected version.
Review Comment:
I think this version is better than the current one, so I've updated it
accordingly.
--
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]