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

   ## Description
   
   [CAMEL-27179](https://issues.apache.org/jira/browse/CAMEL-27179): without 
`pojoRequest`, the `query` operation of `aws2-timestream` built the 
`QueryRequest` from the query string and max rows headers only. It could read 
only the first page of a result: no next token was read or returned.
   
   - New header `CamelAwsTimestreamQueryNextToken`:
     - As input, it is passed to `QueryRequest.nextToken`.
     - As output, it is set from `QueryResponse.nextToken()`, and removed after 
the last page. So a route can loop with `loopDoWhile` until the header is gone.
     - It is the same header name in both directions, so a loop needs no 
copying.
   - New producer option `queryAllPages` (default `false`): follows the pages 
and gives one `QueryResponse`. That response has the rows of all pages, the 
column info, and the other fields of the last page, with no next token.
     - It loops on `query(...)` with the token rather than `queryPaginator`, so 
it also works with a custom or mocked `TimestreamQueryClient`.
     - Pages without rows (a query still running) are followed, because only 
the token tells whether a next page exists.
   - `CamelAwsTimestreamQueryMaxRows` is now described as the page size, which 
is what it is.
   - The body-type description and a new "Paging the query results" doc section 
are updated. The catalog, its doc copy and the DSLs are regenerated.
   
   Needed for paging in the `aws-timestream-query-sink` Kamelet 
(apache/camel-kamelets#3280).
   
   ## Tests
   
   `Timestream2QueryPagingTest` uses a client mock with three pages (2 rows, 0 
rows with a token, 1 row):
   - one page gives the next token
   - the token header reads that page and removes the header on the last page
   - a `loopDoWhile` route collects all the rows
   - `queryAllPages=true` gives all the rows in one response and sends the same 
query string with each token
   
   All 107 unit tests of the module pass.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 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