Claus Ibsen created CAMEL-26077:
-----------------------------------
Summary: camel-aws2-timestream - describeScheduledQuery never
sends the ARN, and the CamelAwsTimestreamRecord header is sent as the common
attributes
Key: CAMEL-26077
URL: https://issues.apache.org/jira/browse/CAMEL-26077
Project: Camel
Issue Type: Bug
Components: camel-aws2
Affects Versions: 4.18.0, 4.22.0, 4.23.0
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of aws2-timestream (CAMEL-24961).
h4. 1. describeScheduledQuery never sends the ARN
In header mode, describeScheduledQuery builds its request without the
{{CamelAwsTimestreamScheduledQueryArn}} header ({{Timestream2QueryProducer}},
main ed3d719b379c, lines 409-413), so it works with pojoRequest=true only. The
test passes because the mock client ignores the request. Checked on
4.24.0-SNAPSHOT with {{camel run}} against a fake of the AWS API that logs the
requests it gets: the request is {{\{\}}}, while deleteScheduledQuery with the
same header sends the ARN.
*Proposed change*: set the ARN from the header.
h4. 2. The CamelAwsTimestreamRecord header is sent as the common attributes
The catalog describes {{CamelAwsTimestreamRecord}} as "a time-series data point
being written into Timestream" ({{Timestream2Constants}}, line 25), but
writeRecords sends it as the common attributes of the records
({{Timestream2WriteProducer}}, lines 765-767). With only this header, no record
is written. Checked on 4.24.0-SNAPSHOT with {{camel run}} against a fake of the
AWS API that logs the requests it gets: the request has {{CommonAttributes}}
and no {{Records}}.
*Proposed change*: describe it as the common attributes, or send it as a record.
h4. 3. No operation fails with a NullPointerException
The operation option has no default, and with no
{{CamelAwsTimestreamOperation}} header the producers fail with a
NullPointerException ({{Timestream2WriteProducer}} and
{{Timestream2QueryProducer}}, line 61). An operation of the other client type
fails only when an exchange is sent, with {{IllegalArgumentException:
Unsupported operation}}, which names neither (lines 78 and 72). Checked on
4.24.0-SNAPSHOT with {{camel run}} against a fake of the AWS API that logs the
requests it gets.
*Proposed change*: fail with a message that names the operation and the client
type, and check both when the endpoint is created.
h4. Also read in the code, not run
* {{CamelAwsTimestreamRecordVersion}} is described as a String (line 42), but
read as a Long (Timestream2WriteProducer, line 175).
* A clientType that is not write or query fails with "No enum constant"
({{Timestream2Component}}, line 51), so the message at line 75 is never given.
* Typos in the header descriptions: "Magentic" and "he ARN". (The POJO example
of the page is fixed with CAMEL-24961.)
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)