jsancio commented on code in PR #19353: URL: https://github.com/apache/kafka/pull/19353#discussion_r2052834226
########## clients/src/main/java/org/apache/kafka/common/requests/AbstractResponse.java: ########## @@ -106,189 +107,189 @@ public static AbstractResponse parseResponse(ByteBuffer buffer, RequestHeader re requestHeader.correlationId(), responseHeader.correlationId()); } - return AbstractResponse.parseResponse(apiKey, buffer, apiVersion); + return AbstractResponse.parseResponse(apiKey, new ByteBufferAccessor(buffer), apiVersion); } - public static AbstractResponse parseResponse(ApiKeys apiKey, ByteBuffer responseBuffer, short version) { + public static AbstractResponse parseResponse(ApiKeys apiKey, ByteBufferAccessor readable, short version) { Review Comment: If you agree with my suggestion, you can change this signature to `parseResponse(ApiKeys, Readable, short)`. ########## clients/src/main/java/org/apache/kafka/common/requests/ApiVersionsResponse.java: ########## @@ -152,19 +151,19 @@ public boolean zkMigrationReady() { return data.zkMigrationReady(); } - public static ApiVersionsResponse parse(ByteBuffer buffer, short version) { + public static ApiVersionsResponse parse(ByteBufferAccessor readable, short version) { Review Comment: The rest of the implementations of `parse` but this one take a `Readable`. Did you consider adding `slice()` to `Readable`? If you do that, this implementation can call `slice()`so that it can parse the response twice if the version is incorrect. -- 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