gitPratikSingh commented on code in PR #29656:
URL: https://github.com/apache/camel/pull/29656#discussion_r4545300284


##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java:
##########
@@ -239,9 +258,27 @@ protected Deque<Exchange> 
createExchanges(Iterator<Result<Item>> minioObjectSumm
                     }
                 }
                 lastListed = minioObjectSummary.objectName();
-            } while (minioObjectSummaries.hasNext());
+                // a limit above 0 caps the objects listed by a poll, so do 
not read further pages of the listing:
+                // the next poll continues after the last listed object. A 
page the server capped below the limit is
+                // truncated, so the listing has not ended when the poll stops 
there or reads it to its end
+                if (maxMessagesPerPoll > 0 && messageCounter >= 
maxMessagesPerPoll) {
+                    if (minioObjectSummaries.hasNext()) {
+                        // a truncated page is not the last fetch of the 
request, so the listing continues
+                        exhaustionKnown = false;
+                    } else {
+                        exhausted = true;
+                    }
+                    break;
+                }

Review Comment:
   resolved



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

Reply via email to