Skip to content

CAMEL-23229 - Camel-AWS2-DDB: Add PartiQL, transactional, and batch w…#22188

Merged
oscerd merged 2 commits intomainfrom
CAMEL-23229
Mar 23, 2026
Merged

CAMEL-23229 - Camel-AWS2-DDB: Add PartiQL, transactional, and batch w…#22188
oscerd merged 2 commits intomainfrom
CAMEL-23229

Conversation

@oscerd
Copy link
Contributor

@oscerd oscerd commented Mar 23, 2026

…rite operations

Add 5 new operations to the AWS DynamoDB component:

  • ExecuteStatement: PartiQL single statement with pagination support
  • BatchExecuteStatement: PartiQL batch statement execution
  • TransactWriteItems: ACID transactional writes with idempotency token
  • TransactGetItems: ACID transactional reads
  • BatchWriteItem: Batch put/delete across tables

Added 14 new header constants, 5 command classes, 5 unit test classes (7 tests), 5 LocalStack integration tests, and documentation with examples for all new operations.

Description

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — Claude Code on behalf of Guillaume Nodet

Good PR — well-structured, follows existing patterns, has solid test coverage (unit + integration), and proper documentation. A few items worth addressing before merge:

1. Naming inconsistency: BatchWriteItem vs BatchGetItems (Medium)

The existing enum value is BatchGetItems (plural), but the new one is BatchWriteItem (singular). The DynamoDB SDK uses singular for both (batchWriteItem, batchGetItem), so the new name is arguably more accurate — but it's inconsistent within Camel's own enum. Worth deciding on a convention before shipping this public API.

Ddb2Operations.java

2. @Metadata labels include BatchExecuteStatement incorrectly (Low)

In Ddb2Constants.java, the STATEMENT and STATEMENT_PARAMETERS constants have label "ExecuteStatement BatchExecuteStatement", but BatchExecuteStatementCommand does not use either of these headers — it uses BATCH_STATEMENTS (which contains BatchStatementRequest objects with their own parameters). The labels should be just "ExecuteStatement".

3. Input/output token asymmetry in ExecuteStatementCommand (Medium)

The command reads the input pagination token from Ddb2Constants.NEXT_TOKEN ("CamelAwsDdbNextToken") but writes the output next token to Ddb2Constants.EXECUTE_STATEMENT_NEXT_TOKEN ("CamelAwsDdbExecuteStatementNextToken"). This means users doing pagination need to manually copy the output header to the input header between iterations. Consider using the same header for both, or at minimum documenting the asymmetry clearly.

4. TransactWriteItemsCommand discards response entirely (Low)

The execute() method calls transactWriteItems() but discards the response without setting any output headers. While the response is sparse (no items), it does contain consumedCapacity() and itemCollectionMetrics() which could be useful. Not a blocker, but worth considering.

5. No tests for missing required headers (Low)

There are no tests covering the case where required headers (e.g., STATEMENT for ExecuteStatement) are missing. Currently this would pass null to the SDK, producing unhelpful NullPointerExceptions. This is consistent with existing commands (pre-existing pattern), so not a blocker for this PR.

What looks good

  • Clean separation of command classes following the established pattern
  • Thorough documentation with examples for all 5 operations
  • PartiQL examples correctly show parameterized queries (mitigating injection risk)
  • Integration tests against LocalStack, plus the comprehensive AWS2NewOperationsRuleIT
  • Generated catalog/DSL files properly updated

oscerd added 2 commits March 23, 2026 13:27
…rite operations

Add 5 new operations to the AWS DynamoDB component:
- ExecuteStatement: PartiQL single statement with pagination support
- BatchExecuteStatement: PartiQL batch statement execution
- TransactWriteItems: ACID transactional writes with idempotency token
- TransactGetItems: ACID transactional reads
- BatchWriteItem: Batch put/delete across tables

Added 14 new header constants, 5 command classes, 5 unit test classes
(7 tests), 5 LocalStack integration tests, and documentation with
examples for all new operations.

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
…rite operations

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd
Copy link
Contributor Author

oscerd commented Mar 23, 2026

@gnodet this is sorted out

@oscerd oscerd merged commit 0a5416e into main Mar 23, 2026
@oscerd oscerd deleted the CAMEL-23229 branch March 23, 2026 12:29
@github-actions
Copy link
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-aws/camel-aws2-ddb
  • dsl/camel-endpointdsl
All tested modules (72 modules)
  • Camel :: AWS2 DDB
  • Camel :: AWS2 DDB [jar]
  • Camel :: All Components Sync point
  • Camel :: All Components Sync point [pom]
  • Camel :: Assembly
  • Camel :: Assembly [pom]
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated) [maven-plugin]
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated) SKIPPED
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Catalog [jar]
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Report Maven Plugin [maven-plugin]
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Camel Route Parser [jar]
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Console [jar]
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Dummy Component [jar]
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Lucene (deprecated) [jar]
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Maven [jar]
  • Camel :: Catalog :: Suggest
  • Camel :: Catalog :: Suggest [jar]
  • Camel :: Component DSL
  • Camel :: Component DSL [jar]
  • Camel :: Coverage
  • Camel :: Coverage [pom]
  • Camel :: Docs
  • Camel :: Docs [pom]
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL [jar]
  • Camel :: Endpoint DSL :: Support
  • Camel :: Endpoint DSL :: Support [jar]
  • Camel :: Integration Tests
  • Camel :: Integration Tests [jar]
  • Camel :: JBang :: Core
  • Camel :: JBang :: Core [jar]
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: Integration tests [jar]
  • Camel :: JBang :: MCP
  • Camel :: JBang :: MCP [jar]
  • Camel :: JBang :: Main
  • Camel :: JBang :: Main [jar]
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Edit [jar]
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Generate [jar]
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: Kubernetes [jar]
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: Route Parser [jar]
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Testing [jar]
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: JBang :: Plugin :: Validate [jar]
  • Camel :: Kamelet Main
  • Camel :: Kamelet Main [jar]
  • Camel :: Launcher
  • Camel :: Launcher [jar]
  • Camel :: Launcher :: Container
  • Camel :: Launcher :: Container [pom]
  • Camel :: YAML DSL
  • Camel :: YAML DSL [jar]
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Deserializers [jar]
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Maven Plugins [maven-plugin]
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator [jar]
  • Camel :: YAML DSL :: Validator Maven Plugin
  • Camel :: YAML DSL :: Validator Maven Plugin [maven-plugin]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants