philipnee commented on code in PR #13380:
URL: https://github.com/apache/kafka/pull/13380#discussion_r1136104123


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -149,6 +185,29 @@ Queue<StagedCommit> stagedCommits() {
         return this.stagedCommits;
     }
 
+    /**
+     * Get all the sendable requests, and create a list of UnsentRequest.
+     */
+    private List<NetworkClientDelegate.UnsentRequest> 
sendOffsetFetchRequests(final long currentTimeMs) {
+        List<UnsentOffsetFetchRequestState> requests = 
unsentOffsetFetchRequests.sendableRequests(currentTimeMs);
+        List<NetworkClientDelegate.UnsentRequest> pollResults = new 
ArrayList<>();
+        requests.forEach(req -> {
+            OffsetFetchRequest.Builder builder = new 
OffsetFetchRequest.Builder(
+                    groupState.groupId, true,
+                    new ArrayList<>(req.requestedPartitions),
+                    throwOnFetchStableOffsetUnsupported);
+            NetworkClientDelegate.UnsentRequest unsentRequest = new 
NetworkClientDelegate.UnsentRequest(
+                    builder,
+                    coordinatorRequestManager.coordinator());
+            FetchCommittedOffsetResponseHandler cb = new 
FetchCommittedOffsetResponseHandler(req);
+            unsentRequest.future().whenComplete((r, t) -> {

Review Comment:
   When we first made the FutureCompletionHandler, we explicitly handled the 
responses in the onComplete method here:
   ```            if (response.authenticationException() != null) {
                   onFailure(response.authenticationException());
               } else if (response.wasDisconnected()) {
                   onFailure(DisconnectException.INSTANCE);
               } else if (response.versionMismatch() != null) {
                   onFailure(response.versionMismatch());
               } else {
                   future.complete(response);
               }
   ```
               
   I was thinking about your suggestion, but since you mentioned it again, let 
me try to refactor this a bit to make it more pluggin-able           



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