oscerd opened a new pull request, #31270:
URL: https://github.com/apache/camel/pull/31270

   ## Problem
   
   All three built their request with no token and no page size, and set the 
first page as the body:
   
   ```java
   ListVectorBucketsRequest request = 
ListVectorBucketsRequest.builder().build();
   ListVectorBucketsResponse response = client.listVectorBuckets(request);
   message.setBody(response.vectorBuckets());
   ```
   
   Every one of the three answers carries a `nextToken` (checked against 
`s3vectors-2.57.7`), which was neither followed nor surfaced, so a route could 
not get past the first page.
   
   ## Changes
   
   Three headers, shared by the three operations:
   
   | header | direction | meaning |
   |---|---|---|
   | `CamelAwsS3VectorsNextToken` | in and out | resume point; set to the next 
page's token, **removed** on the last page |
   | `CamelAwsS3VectorsMaxResults` | in | page size for the two list operations 
|
   | `CamelAwsS3VectorsIsTruncated` | out | whether more pages follow |
   
   `queryVectors` takes the token only — the SDK request has `nextToken` but no 
`maxResults`, because `topK` is its page size. Two small private helpers 
(`applyPaging`, `setNextToken`) keep the three call sites identical.
   
   Dropping the token header on the last page means a route can loop while it 
is present and terminate on its own. Documented in the component page.
   
   ## Tests
   
   `AWS2S3VectorsProducerPagingTest` captures the request with Mockito and 
asserts both directions for each operation: the token and page size reach the 
SDK request, the next token and truncation flag come back, and the last page 
clears the token. All four cases fail against unmodified code.
   
   ## Not in this PR
   
   CAMEL-28039 also reports that the module has no `pojoRequest`, unlike its 
`aws2-s3` sibling and 30 other AWS schemes. That means adding the option plus a 
POJO branch to each of the twelve operations — a feature of its own size, and 
not something I wanted to mix into a pagination fix. **The ticket should stay 
open for it.** Happy to take it as the next change if you want.
   
   ## Testing
   
   `mvn test` in `components/camel-aws/camel-aws2-s3-vectors`: 30 tests, all 
passing.
   
   _Claude Code on behalf of oscerd_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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