Skip to content

AWS DDB sink Kamelet does not reliably set the DynamoDB operation #2941

Description

@christophd

Description

The aws-ddb-sink Kamelet does not reliably set the DynamoDB operation via its operation property. The Kamelet template sets the operation as an Exchange property (setProperty name=operation), but this does not take effect in all cases — most notably for UpdateItem.

The Kamelet template currently does this (in kamelets/aws-ddb-sink.kamelet.yaml):

template:
  from:
    uri: "kamelet:source"
    steps:
    - setProperty:
        name: operation
        constant: "{{operation}}"
    - transformDataType:
        toType: "aws2-ddb:application-json"
    - to:
        uri: "aws2-ddb:{{table}}"
        parameters:
          operation: "{{operation}}"

Even though operation is passed both as an Exchange property and as an endpoint parameter, the UpdateItem operation is not applied correctly. This caused the integration test aws-ddb-sink-update-item.citrus.it.yaml to fail consistently, and the test was disabled.

Steps to Reproduce

  1. Use the aws-ddb-sink Kamelet with operation=UpdateItem
  2. Send an update item JSON payload
  3. The operation defaults to PutItem instead of UpdateItem

Expected Behavior

The Kamelet should reliably apply the configured operation (e.g. UpdateItem) when processing messages.

Actual Behavior

The UpdateItem operation is not applied; the Kamelet falls back to the default PutItem operation.

Workaround

Setting the Exchange property operation in the calling route before invoking the Kamelet sink works:

- setProperty:
    name: operation
    constant: "{{aws.ddb.operation}}"
- to:
    uri: "kamelet:aws-ddb-sink"
    parameters:
      operation: "{{aws.ddb.operation}}"

Additional Context

  • The test aws-ddb-sink-update-item.citrus.it.yaml has the workaround applied and is now passing
  • The root cause may be related to how the kamelet: component handles property binding vs. Exchange property propagation — the setProperty inside the Kamelet template may be overwritten or not propagated correctly through the transformDataType step
  • This may need investigation in apache/camel (the Kamelet runtime) rather than a fix in the Kamelet template itself

Claude Code on behalf of Christoph Deppisch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions