Repository: camel Updated Branches: refs/heads/master 9b2f2989b -> 8392379c3
CAMEL-10723: Improved camel-aws kinesis documentation Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4d9ea2e8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4d9ea2e8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4d9ea2e8 Branch: refs/heads/master Commit: 4d9ea2e867c836e302c416446bb6fb54aaf761d7 Parents: 9b2f298 Author: Pontus Ullgren <[email protected]> Authored: Wed Jan 18 15:02:28 2017 +0100 Committer: Andrea Cosentino <[email protected]> Committed: Thu Jan 19 10:10:48 2017 +0100 ---------------------------------------------------------------------- .../src/main/docs/aws-kinesis-component.adoc | 14 +++++++++++--- .../camel/component/aws/kinesis/KinesisEndpoint.java | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/4d9ea2e8/components/camel-aws/src/main/docs/aws-kinesis-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc index 6a59c3b..328831b 100644 --- a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc +++ b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc @@ -2,7 +2,7 @@ *Available as of Camel 2.17* -The Kinesis component supports receiving messages from Amazon Kinesis +The Kinesis component supports receiving messages from and sending messages to Amazon Kinesis service. Prerequisites @@ -108,7 +108,7 @@ size is not defined by the API. If it is to be used as a numerical type then use #### AmazonKinesis configuration -You will need to create an instance of AmazonDynamoDBStreamsClient and +You will need to create an instance of AmazonKinesisClient and bind it to the registry [source,java] @@ -118,12 +118,20 @@ clientConfiguration.setProxyHost("http://myProxyHost"); clientConfiguration.setProxyPort(8080); Region region = Region.getRegion(Regions.fromName(region)); -region.createClient(AmazonDynamoDBStreamsClient.class, null, clientConfiguration); +region.createClient(AmazonKinesisClient.class, null, clientConfiguration); // the 'null' here is the AWSCredentialsProvider which defaults to an instance of DefaultAWSCredentialsProviderChain registry.bind("kinesisClient", client); -------------------------------------------------------------------------------------------------------------------- +You then have to reference the AmazonKinesisClient in the `amazonKinesisClient` URI option. + +[source,java] +-------------------------------------------------------------------------------------------------------------------- +from("aws-kinesis://mykinesisstream?amazonKinesisClient=#kinesisClient") + .to("log:out?showAll=true"); +-------------------------------------------------------------------------------------------------------------------- + #### Providing AWS Credentials It is recommended that the credentials are obtained by using the http://git-wip-us.apache.org/repos/asf/camel/blob/4d9ea2e8/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java index 833a230..2568c98 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java @@ -43,11 +43,11 @@ public class KinesisEndpoint extends ScheduledPollEndpoint { private AmazonKinesis amazonKinesisClient; @UriParam(label = "consumer", description = "Maximum number of records that will be fetched in each poll", defaultValue = "1") private int maxResultsPerRequest = 1; - @UriParam(label = "consumer", description = "Defines where in the Kinesis stream to start getting records") + @UriParam(label = "consumer", description = "Defines where in the Kinesis stream to start getting records", defaultValue = "TRIM_HORIZON") private ShardIteratorType iteratorType = ShardIteratorType.TRIM_HORIZON; @UriParam(label = "consumer", description = "Defines which shardId in the Kinesis stream to get records from") private String shardId = ""; - @UriParam(label = "consumer", description = "The sequence number to start polling from") + @UriParam(label = "consumer", description = "The sequence number to start polling from. Required if iteratorType is set to AFTER_SEQUENCE_NUMBER or AT_SEQUENCE_NUMBER") private String sequenceNumber = ""; public KinesisEndpoint(String uri, String streamName, KinesisComponent component) {
