Claus Ibsen created CAMEL-27877:
-----------------------------------

             Summary: camel-aws2-ddb: Query cannot use the expression headers, 
TransactWriteItems result headers are always empty
                 Key: CAMEL-27877
                 URL: https://issues.apache.org/jira/browse/CAMEL-27877
             Project: Camel
          Issue Type: Bug
          Components: camel-aws2
            Reporter: Claus Ibsen
             Fix For: 4.25.0


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

h4. 1. Query cannot use the expression headers
{{QueryCommand.execute}} sends the key conditions only as the legacy 
KeyConditions parameter (there is no KeyConditionExpression header). DynamoDB 
rejects a request that mixes legacy and expression parameters, so 
CamelAwsDdbFilterExpression, CamelAwsDdbProjectExpression and the expression 
attribute headers cannot be used with Query (AWS2QueryRuleIT tests them with 
operation Scan).
Proposed change: add a CamelAwsDdbKeyConditionExpression header passed to 
keyConditionExpression(), and send keyConditions only when it is not set.

h4. 2. TransactWriteItems result headers are always empty
{{TransactWriteItemsCommand.execute}} never sets ReturnConsumedCapacity or 
ReturnItemCollectionMetrics, and the SDK getters return empty auto-construct 
collections (never null), so CamelAwsDdbTransactWriteConsumedCapacity is always 
an empty list and CamelAwsDdbTransactWriteItemCollectionMetrics an empty map.
Proposed change: set ReturnConsumedCapacity.TOTAL and 
ReturnItemCollectionMetrics.SIZE (or a header for each), and use 
hasConsumedCapacity()/hasItemCollectionMetrics().


_Claude Code on behalf of davsclaus_



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

Reply via email to