Repository: camel Updated Branches: refs/heads/camel-2.18.x 550e1f3ef -> 57e8d6d49
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/1c1238ec Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1c1238ec Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1c1238ec Branch: refs/heads/camel-2.18.x Commit: 1c1238eca1dd6b71dfb550762142945bed19b25a Parents: 550e1f3 Author: Pontus Ullgren <[email protected]> Authored: Wed Jan 18 15:02:28 2017 +0100 Committer: Andrea Cosentino <[email protected]> Committed: Thu Jan 19 10:38:12 2017 +0100 ---------------------------------------------------------------------- .../src/main/docs/aws-kinesis-component.adoc | 18 ++++++++++++------ .../component/aws/kinesis/KinesisEndpoint.java | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1c1238ec/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 0d1590f..5484c49 100644 --- a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc +++ b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc @@ -4,7 +4,7 @@ Kinesis Component *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 @@ -122,7 +122,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] @@ -132,15 +132,21 @@ 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); -------------------------------------------------------------------------------------------------------------------- -[[AWS-KINESIS-ProvidingAWSCredentials]] -Providing AWS Credentials -+++++++++++++++++++++++++ +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://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html[DefaultAWSCredentialsProviderChain] http://git-wip-us.apache.org/repos/asf/camel/blob/1c1238ec/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) {
