chia7712 commented on code in PR #23665:
URL: https://github.com/apache/kafka/pull/23665#discussion_r4643607765
##########
clients/src/main/java/org/apache/kafka/common/requests/RequestContext.java:
##########
@@ -148,17 +174,28 @@ public Send buildResponseSend(AbstractResponse body) {
* so we do not lose the benefit of "zero copy" transfers from disk.
*/
public ByteBuffer buildResponseEnvelopePayload(AbstractResponse body) {
- return body.serializeWithHeader(header.toResponseHeader(),
apiVersion());
+ short version = effectiveApiVersion();
+ return body.serializeWithHeader(responseHeader(version), version);
}
- private boolean isUnsupportedApiVersionsRequest() {
- return header.apiKey() == API_VERSIONS &&
!header.isApiVersionSupported();
+ private ResponseHeader responseHeader(short responseVersion) {
+ return new ResponseHeader(header.correlationId(),
header.apiKey().responseHeaderVersion(responseVersion));
}
- public short apiVersion() {
- // Use v0 when serializing an unhandled ApiVersion response
- if (isUnsupportedApiVersionsRequest())
- return 0;
+ private boolean isApiVersionsFallback() {
+ return header.apiKey().isFallbackVersion(header.apiVersion());
Review Comment:
opened https://issues.apache.org/jira/browse/KAFKA-21596
--
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]