Claus Ibsen created CAMEL-27678:
-----------------------------------

             Summary: camel-aws2-timestream: list ops lack a next token, 
operation and label wrongly required
                 Key: CAMEL-27678
                 URL: https://issues.apache.org/jira/browse/CAMEL-27678
             Project: Camel
          Issue Type: Bug
          Components: camel-aws2
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while improving the option descriptions of camel-aws2-timestream for 
CAMEL-23832 (commit 
https://github.com/apache/camel/commit/adc7ee2d6d529a5b8e4732a2fb95e969055694db).
These are separate problems of the component; the descriptions commit only 
documents the current behavior.

h4. 1. The list operations cannot read past the first page
{{Timestream2WriteProducer.listBatchLoadTasks()}}, {{listDatabases()}} and 
{{listTables()}}, and {{Timestream2QueryProducer.listScheduledQueries()}} set 
only {{maxResults}} (and {{taskStatus}} or {{databaseName}}) on the request. No 
header gives the {{nextToken}}. When there are more items than one page holds, 
the response has a {{nextToken}}, but the user has no way to pass it back 
without {{pojoRequest=true}}.
Proposed change: read a next token header for these operations, as the query 
operation does with {{CamelAwsTimestreamQueryNextToken}}, and set it on the 
message from the response.

h4. 2. The operation option is marked required, but a header can replace it
{{Timestream2Configuration.operation}} has {{@Metadata(required = true)}}, but 
{{determineOperation()}} of both producers takes the 
{{CamelAwsTimestreamOperation}} header first and uses the option only when the 
header is not set. The catalog and tooling then ask for an option that a route 
does not need.
Proposed change: drop {{required = true}}, as the producer already fails with a 
clear message when neither is set.

h4. 3. The label path option is marked required but not used
{{Timestream2Component.createEndpoint()}} splits the path and reads only the 
first part as the client type, so 
{{aws2-timestream:write?operation=listDatabases}} works without a label. 
{{Timestream2Configuration}} has no setter for {{label}} or {{clientType}}, so 
neither value is stored, and {{getClientType()}} always returns null.
Proposed change: mark {{label}} as not required (or remove it from the syntax), 
and set the client type on the configuration or remove the unused getter.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to