You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/09/15 08:55:45 UTC

[camel] 02/02: CAMEL-16849 - Add at least one example for component in docs - Camel-AWS2-DDB

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit df933f4a027685a856f6dcd895400836969b1877
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Sep 15 10:53:52 2021 +0200

    CAMEL-16849 - Add at least one example for component in docs - Camel-AWS2-DDB
---
 .../src/main/docs/aws2-ddb-component.adoc             | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc b/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
index f890805..52901d0 100644
--- a/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
+++ b/components/camel-aws/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
@@ -394,6 +394,25 @@ Registry.
 
 == Dependencies
 
+== Examples
+
+=== Producer Examples
+
+- PutItem: this operation will create an entry into DynamoDB
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:start")
+  .setHeader(Ddb2Constants.OPERATION, Ddb2Operations.PutItem)
+  .setHeader(Ddb2Constants.CONSISTENT_READ, "true")
+  .setHeader(Ddb2Constants.RETURN_VALUES, "ALL_OLD")
+  .setHeader(Ddb2Constants.ITEM, attributeMap)
+  .setHeader(Ddb2Constants.ATTRIBUTE_NAMES, attributeMap.keySet());
+  .to("aws2-ddb://" + tableName + "?keyAttributeName=" + attributeName + "&keyAttributeType=" + KeyType.HASH
+  + "&keyScalarType=" + ScalarAttributeType.S
+  + "&readCapacity=1&writeCapacity=1");
+--------------------------------------------------------------------------------
+
 Maven users will need to add the following dependency to their pom.xml.
 
 *pom.xml*