fhussonnois commented on code in PR #19188:
URL: https://github.com/apache/kafka/pull/19188#discussion_r2034709792


##########
clients/src/main/java/org/apache/kafka/clients/consumer/MockConsumer.java:
##########
@@ -294,13 +306,17 @@ public synchronized ConsumerRecords<K, V> poll(final 
Duration timeout) {
                                 rec.offset() + 1, rec.leaderEpoch(), 
leaderAndEpoch);
                         subscriptions.position(entry.getKey(), newPosition);
                         nextOffsetAndMetadata.put(entry.getKey(), new 
OffsetAndMetadata(rec.offset() + 1, rec.leaderEpoch(), ""));
+                        numPollRecords++;
+                        recIterator.remove();
                     }
                 }
-                toClear.add(entry.getKey());
+
+                if (entry.getValue().isEmpty()) {

Review Comment:
   Method `isEmpty` doesn't exist on Iterator.



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