jolshan commented on code in PR #14444:
URL: https://github.com/apache/kafka/pull/14444#discussion_r1348125403


##########
clients/src/main/java/org/apache/kafka/common/requests/FetchResponse.java:
##########
@@ -276,11 +289,16 @@ private static FetchResponseData toMessage(Errors error,
                     .setPartitions(partitionResponses));
             }
         }
-
-        return new FetchResponseData()
-            .setThrottleTimeMs(throttleTimeMs)
-            .setErrorCode(error.code())
-            .setSessionId(sessionId)
-            .setResponses(topicResponseList);
+        data.setThrottleTimeMs(throttleTimeMs)
+                .setErrorCode(error.code())
+                .setSessionId(sessionId)
+                .setResponses(topicResponseList);
+        nodeEndpoints.forEach(endpoint -> data.nodeEndpoints().add(

Review Comment:
   Could we also create the nodeEndpoints together so we keep the final data 
object relatively clean. (Ie we generate the response data structure above, we 
could also generate the enpoints data structure above.) 



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

Reply via email to