gnodet-bot commented on code in PR #31262:
URL: https://github.com/apache/camel/pull/31262#discussion_r4770600404


##########
components/camel-aws/camel-aws2-s3/src/main/docs/aws2-s3-producer-operations.adoc:
##########
@@ -186,6 +187,29 @@ and the key from the `keyName` option, unless the 
`CamelAwsS3Key` header is set.
 
 This section covers operations that require special configuration beyond the 
common pattern.
 
+[[listPaging]]
+=== Paging listObjects and listBuckets
+
+Amazon S3 answers `listObjects` and `listBuckets` one page at a time, at most 
1000 entries per page. Set
+`CamelAwsS3MaxKeys` to ask for a smaller page. When more entries follow, the 
producer sets
+`CamelAwsS3IsTruncated` to `true` and `CamelAwsS3ContinuationToken` to the 
token of the next page; send that token
+back in `CamelAwsS3ContinuationToken` to read on. On the last page the 
producer sets `CamelAwsS3IsTruncated` to
+`false` and **removes** `CamelAwsS3ContinuationToken`, so a route that loops 
while the header is present stops by
+itself.
+
+[source,java]
+----
+from("direct:listAll")
+    
.loopDoWhile(header(AWS2S3Constants.CONTINUATION_TOKEN).isNotNull().or(exchangeProperty("firstPass").isNull()))
+        .setProperty("firstPass", constant(false))
+        .to("aws2-s3://mybucket?operation=listObjects")
+        .log("got ${body.size()} objects, more: 
${header.CamelAwsS3IsTruncated}")
+    .end();
+----
+
+In POJO mode the token is read from the `ListObjectsV2Request` body, and the 
producer still sets the two headers on
+the answer.
+
 [[uploadObject]]

Review Comment:
   test comment



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