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 2020/02/11 09:55:40 UTC

[camel] 04/04: CAMEL-14519 - Create an AWS-DDB component based on SDK v2, Regen docs

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

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

commit 75d377faaeb4e32d889fbc01f80f5da899df3815
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Feb 11 10:51:35 2020 +0100

    CAMEL-14519 - Create an AWS-DDB component based on SDK v2, Regen docs
---
 docs/components/modules/ROOT/nav.adoc              |  3 -
 .../modules/ROOT/pages/aws2-ddb-component.adoc     | 88 ++++-----------------
 .../ROOT/pages/aws2-ddbstream-component.adoc       | 92 +++-------------------
 .../modules/ROOT/pages/aws2-ecs-component.adoc     |  2 +-
 docs/components/modules/ROOT/pages/index.adoc      |  4 +-
 5 files changed, 29 insertions(+), 160 deletions(-)

diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index 4ee8721..df6bddc 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -46,11 +46,8 @@
 * xref:aws2-cw-component.adoc[AWS 2 CloudWatch Component]
 * xref:aws2-ddb-component.adoc[AWS 2 DynamoDB Component]
 * xref:aws2-ddbstream-component.adoc[AWS 2 DynamoDB Streams Component]
-* xref:aws2-ddb-component.adoc[AWS 2 DynamoDB Component]
-* xref:aws2-ddbstream-component.adoc[AWS 2 DynamoDB Streams Component]
 * xref:aws2-ec2-component.adoc[AWS 2 EC2 Component]
 * xref:aws2-ecs-component.adoc[AWS 2 ECS Component]
-* xref:aws2-ecs-component.adoc[AWS 2 ECS Component]
 * xref:aws2-eks-component.adoc[AWS 2 EKS Component]
 * xref:aws2-iam-component.adoc[AWS 2 IAM Component]
 * xref:aws2-kms-component.adoc[AWS 2 KMS Component]
diff --git a/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc b/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc
index dc0b724..549d16a 100644
--- a/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc
@@ -1,9 +1,6 @@
 [[aws2-ddb-component]]
 = AWS 2 DynamoDB Component
-:page-source: components/camel-aws2-ddb/bin/src/main/docs/aws2-ddb-component.adoc
-= AWS DynamoDB Component
-*Since Camel 3.1*
-
+:page-source: components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
 
 *Since Camel 3.1*
 
@@ -20,11 +17,16 @@ You must have a valid Amazon Web Services developer account, and be
 signed up to use Amazon DynamoDB. More information is available at
 https://aws.amazon.com/dynamodb[Amazon DynamoDB].
 
+[NOTE]
+====
+The AWS2 DynamoDB component is not supported in OSGI
+====
+
 == URI Format
 
 [source,java]
 ------------------------------
-aws-ddb://domainName[?options]
+aws2-ddb://domainName[?options]
 ------------------------------
 
 You can append query options to the URI in the following format,
@@ -85,7 +87,7 @@ with the following path and query parameters:
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | What operation to perform. The value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations
 | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client |  | String
-| *proxyPort* (producer) | To define a proxy port when instantiating the DDB client. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | Integer
+| *proxyPort* (producer) | The region in which DynamoDB client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
 | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table |  | Long
 | *region* (producer) | The region in which DDB client needs to work |  | String
@@ -96,56 +98,10 @@ with the following path and query parameters:
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===
 // endpoint options: END
-// spring-boot-auto-configure options: START
-== Spring Boot Auto-Configuration
-
-When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:
-
-[source,xml]
-----
-<dependency>
-  <groupId>org.apache.camel.springboot</groupId>
-  <artifactId>camel-aws-ddb-starter</artifactId>
-  <version>x.x.x</version>
-  <!-- use the same version as your Camel core version -->
-</dependency>
-----
-
-
-The component supports 21 options, which are listed below.
-
 
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *camel.component.aws-ddb.access-key* | Amazon AWS Access Key |  | String
-| *camel.component.aws-ddb.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean
-| *camel.component.aws-ddb.bridge-error-handler* | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean
-| *camel.component.aws-ddb.configuration.access-key* | Amazon AWS Access Key |  | String
-| *camel.component.aws-ddb.configuration.amazon-d-d-b-client* | To use the AmazonDynamoDB as the client |  | AmazonDynamoDB
-| *camel.component.aws-ddb.configuration.consistent-read* | Determines whether or not strong consistency should be enforced when data is read. | false | Boolean
-| *camel.component.aws-ddb.configuration.key-attribute-name* | Attribute name when creating table |  | String
-| *camel.component.aws-ddb.configuration.key-attribute-type* | Attribute type when creating table |  | String
-| *camel.component.aws-ddb.configuration.operation* | What operation to perform |  | DdbOperations
-| *camel.component.aws-ddb.configuration.proxy-host* | To define a proxy host when instantiating the DDB client |  | String
-| *camel.component.aws-ddb.configuration.proxy-port* | To define a proxy port when instantiating the DDB client. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | Integer
-| *camel.component.aws-ddb.configuration.proxy-protocol* | To define a proxy protocol when instantiating the DDB client |  | Protocol
-| *camel.component.aws-ddb.configuration.read-capacity* | The provisioned throughput to reserve for reading resources from your table |  | Long
-| *camel.component.aws-ddb.configuration.region* | The region in which DDB client needs to work |  | String
-| *camel.component.aws-ddb.configuration.secret-key* | Amazon AWS Secret Key |  | String
-| *camel.component.aws-ddb.configuration.table-name* | The name of the table currently worked with. |  | String
-| *camel.component.aws-ddb.configuration.write-capacity* | The provisioned throughput to reserved for writing resources to your table |  | Long
-| *camel.component.aws-ddb.enabled* | Whether to enable auto configuration of the aws-ddb component. This is enabled by default. |  | Boolean
-| *camel.component.aws-ddb.lazy-start-producer* | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed th [...]
-| *camel.component.aws-ddb.region* | The region in which DDB client needs to work |  | String
-| *camel.component.aws-ddb.secret-key* | Amazon AWS Secret Key |  | String
-|===
+// spring-boot-auto-configure options: START
 // spring-boot-auto-configure options: END
 
-
-
-
 Required DDB component options
 
 You have to provide the amazonDDBClient in the
@@ -353,26 +309,12 @@ URI:
 [source,java]
 ----------------------------------------------------
 from("direct:start")
-.to("aws-ddb://domainName?amazonDDBClient=#client");
+.to("aws2-ddb://domainName?amazonDDBClient=#client");
 ----------------------------------------------------
 
-The `#client` refers to a `AmazonDynamoDB` in the
+The `#client` refers to a `DynamoDbClient` in the
 Registry.
 
-For example if your Camel Application is running behind a firewall:
-
-[source,java]
---------------------------------------------------------------------------------------
-AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey");
-ClientConfiguration clientConfiguration = new ClientConfiguration();
-clientConfiguration.setProxyHost("http://myProxyHost");
-clientConfiguration.setProxyPort(8080);
-
-AmazonDynamoDB client = new AmazonDynamoDBClient(awsCredentials, clientConfiguration);
-
-registry.bind("client", client);
---------------------------------------------------------------------------------------
-
 == Supported producer operations
 
 - BatchGetItems
@@ -386,9 +328,9 @@ registry.bind("client", client);
 - UpdateItem
 - UpdateTable
 
-== Automatic detection of AmazonDynamoDB client in registry
+== Automatic detection of DynamoDbClient client in registry
 
-The component is capable of detecting the presence of an AmazonDynamoDB bean into the registry.
+The component is capable of detecting the presence of an DynamoDbClient bean into the registry.
 If it's the only instance of that type it will be used as client and you won't have to define it as uri parameter.
 This may be really useful for smarter configuration of the endpoint.
 
@@ -402,9 +344,9 @@ Maven users will need to add the following dependency to their pom.xml.
 ---------------------------------------
 <dependency>
     <groupId>org.apache.camel</groupId>
-    <artifactId>camel-aws-ddb</artifactId>
+    <artifactId>camel-aws2-ddb</artifactId>
     <version>${camel-version}</version>
 </dependency>
 ---------------------------------------
 
-where `$\{camel-version\}` must be replaced by the actual version of Camel.
\ No newline at end of file
+where `$\{camel-version\}` must be replaced by the actual version of Camel.
diff --git a/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc b/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc
index 7797fc6..becfab9 100644
--- a/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc
@@ -1,9 +1,6 @@
 [[aws2-ddbstream-component]]
 = AWS 2 DynamoDB Streams Component
-:page-source: components/camel-aws2-ddb/bin/src/main/docs/aws2-ddbstream-component.adoc
-= AWS DynamoDB Streams Component
-*Since Camel 3.1*
-
+:page-source: components/camel-aws2-ddb/src/main/docs/aws2-ddbstream-component.adoc
 
 *Since Camel 3.1*
 
@@ -20,11 +17,16 @@ You must have a valid Amazon Web Services developer account, and be
 signed up to use Amazon DynamoDB Streams. More information are available
 at https://aws.amazon.com/dynamodb/[AWS DynamoDB]
 
+[NOTE]
+====
+The AWS2 DynamoDB Streams component is not supported in OSGI
+====
+
 == URI Format
 
 [source,java]
 ------------------------------------
-aws-ddbstream://table-name[?options]
+aws2-ddbstream://table-name[?options]
 ------------------------------------
 
 The stream needs to be created prior to it being used. +
@@ -115,57 +117,12 @@ with the following path and query parameters:
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
-== Spring Boot Auto-Configuration
-
-When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:
-
-[source,xml]
-----
-<dependency>
-  <groupId>org.apache.camel.springboot</groupId>
-  <artifactId>camel-aws-ddb-starter</artifactId>
-  <version>x.x.x</version>
-  <!-- use the same version as your Camel core version -->
-</dependency>
-----
-
-
-The component supports 18 options, which are listed below.
-
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *camel.component.aws-ddbstream.access-key* | Amazon AWS Access Key |  | String
-| *camel.component.aws-ddbstream.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean
-| *camel.component.aws-ddbstream.bridge-error-handler* | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean
-| *camel.component.aws-ddbstream.configuration.access-key* | Amazon AWS Access Key |  | String
-| *camel.component.aws-ddbstream.configuration.amazon-dynamo-db-streams-client* | Amazon DynamoDB client to use for all requests for this endpoint |  | AmazonDynamoDBStreams
-| *camel.component.aws-ddbstream.configuration.iterator-type* | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. |  | ShardIteratorType
-| *camel.component.aws-ddbstream.configuration.max-results-per-request* | Maximum number of records that will be fetched in each poll |  | Integer
-| *camel.component.aws-ddbstream.configuration.proxy-host* | To define a proxy host when instantiating the DDBStreams client |  | String
-| *camel.component.aws-ddbstream.configuration.proxy-port* | To define a proxy port when instantiating the DDBStreams client |  | Integer
-| *camel.component.aws-ddbstream.configuration.proxy-protocol* | To define a proxy protocol when instantiating the DDBStreams client |  | Protocol
-| *camel.component.aws-ddbstream.configuration.region* | The region in which DDBStreams client needs to work |  | String
-| *camel.component.aws-ddbstream.configuration.secret-key* | Amazon AWS Secret Key |  | String
-| *camel.component.aws-ddbstream.configuration.sequence-number-provider* | Provider for the sequence number when using one of the two ShardIteratorType.{AT,AFTER}_SEQUENCE_NUMBER iterator types. Can be a registry reference or a literal sequence number. |  | SequenceNumberProvider
-| *camel.component.aws-ddbstream.configuration.table-name* | Name of the dynamodb table |  | String
-| *camel.component.aws-ddbstream.enabled* | Whether to enable auto configuration of the aws-ddbstream component. This is enabled by default. |  | Boolean
-| *camel.component.aws-ddbstream.lazy-start-producer* | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is proces [...]
-| *camel.component.aws-ddbstream.region* | Amazon AWS Region |  | String
-| *camel.component.aws-ddbstream.secret-key* | Amazon AWS Secret Key |  | String
-|===
 // spring-boot-auto-configure options: END
 
 
+Required DynamoDBStream component options
 
-
-
-
-Required DynampDBStream component options
-
-You have to provide the amazonDynamoDbStreamsClient in the
+You have to provide the DynamoDbStreamsClient in the
 Registry with proxies and relevant credentials
 configured.
 
@@ -189,33 +146,6 @@ aggregate this number of messages.
 
 == Usage
 
-=== AmazonDynamoDBStreamsClient configuration
-
-You will need to create an instance of AmazonDynamoDBStreamsClient and
-bind it to the registry
-
-[source,java]
---------------------------------------------------------------------------------------------------------------------
-ClientConfiguration clientConfiguration = new ClientConfiguration();
-clientConfiguration.setProxyHost("http://myProxyHost");
-clientConfiguration.setProxyPort(8080);
-
-Region region = Region.getRegion(Regions.fromName(region));
-region.createClient(AmazonDynamoDBStreamsClient.class, null, clientConfiguration);
-// the 'null' here is the AWSCredentialsProvider which defaults to an instance of DefaultAWSCredentialsProviderChain
-
-registry.bind("kinesisClient", client);
---------------------------------------------------------------------------------------------------------------------
-
-=== Providing AWS Credentials
-
-It is recommended that the credentials are obtained by using the
-http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html[DefaultAWSCredentialsProviderChain]
-that is the default when creating a new ClientConfiguration instance,
-however, a
-different http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html[AWSCredentialsProvider]
-can be specified when calling createClient(...).
-
 == Coping with Downtime
 
 === AWS DynamoDB Streams outage of less than 24 hours
@@ -247,9 +177,9 @@ Maven users will need to add the following dependency to their pom.xml.
 ---------------------------------------
 <dependency>
     <groupId>org.apache.camel</groupId>
-    <artifactId>camel-aws</artifactId>
+    <artifactId>camel-aws2-ddb</artifactId>
     <version>${camel-version}</version>
 </dependency>
 ---------------------------------------
 
-where `$\{camel-version\}` must be replaced by the actual version of Camel.
\ No newline at end of file
+where `$\{camel-version\}` must be replaced by the actual version of Camel.
diff --git a/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc b/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc
index 172886c..06f585c 100644
--- a/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-ecs-component.adoc
@@ -1,6 +1,6 @@
 [[aws2-ecs-component]]
 = AWS 2 ECS Component
-:page-source: components/camel-aws2-ecs/bin/src/main/docs/aws2-ecs-component.adoc
+:page-source: components/camel-aws2-ecs/src/main/docs/aws2-ecs-component.adoc
 
 *Since Camel 3.1*
 
diff --git a/docs/components/modules/ROOT/pages/index.adoc b/docs/components/modules/ROOT/pages/index.adoc
index ebf39a6..fa81a27 100644
--- a/docs/components/modules/ROOT/pages/index.adoc
+++ b/docs/components/modules/ROOT/pages/index.adoc
@@ -48,9 +48,9 @@ Number of Components: 322 in 259 JAR artifacts (1 deprecated)
 
 | xref:aws2-cw-component.adoc[AWS 2 CloudWatch] (camel-aws2-cw) | 3.1 | The aws2-cw component is used for sending metrics to an Amazon CloudWatch.
 
-| xref:aws2-ddb-component.adoc[AWS 2 DynamoDB] (camel-aws2-ddb) | 3.1 | The aws-ddb component is used for storing and retrieving data from Amazon's DynamoDB service.
+| xref:aws2-ddb-component.adoc[AWS 2 DynamoDB] (camel-aws2-ddb) | 3.1 | The aws2-ddb component is used for storing and retrieving data from Amazon's DynamoDB service.
 
-| xref:aws2-ddbstream-component.adoc[AWS 2 DynamoDB Streams] (camel-aws2-ddb) | 3.1 | The aws-ddbstream component is used for working with Amazon DynamoDB Streams.
+| xref:aws2-ddbstream-component.adoc[AWS 2 DynamoDB Streams] (camel-aws2-ddb) | 3.1 | The aws2-ddbstream component is used for working with Amazon DynamoDB Streams.
 
 | xref:aws2-ec2-component.adoc[AWS 2 EC2] (camel-aws2-ec2) | 3.1 | The aws2-ec2 is used for managing Amazon EC2 instances.