Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
10.6. AWS-Kinesis
Kinesis Component 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Available as of Camel 2.17
The Kinesis component supports receiving messages from and sending messages to Amazon Kinesis service.
Note
You must have a valid Amazon Web Services developer account, and be signed up to use Amazon Kinesis. More information are available at AWS Kinesis
URI Format 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
aws-kinesis://stream-name[?options]
aws-kinesis://stream-name[?options]
The stream needs to be created prior to it being used. You can append query options to the URI in the following format, ?options=value&option2=value&...
URI Options 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Name
|
Default Value
|
Context
|
Description
|
---|---|---|---|
amazonKinesisClient
|
null
|
Consumer
|
Reference to a
com.amazonaws.services.kinesis.AmazonKinesisClient in the Registry.
|
maxMessagesPerPoll
|
100
|
Consumer
|
Maximum results that will be returned in each poll to the AWS API, Given that the shard iterator is unique to the consumer, changing it shouldn't effect other consumers.
|
iteratorType
|
TRIM_HORIZON
|
Consumer
|
One of trim_horizon or latest. See http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html for descriptions of these two iterator types.
|
Note
You have to provide the amazonKinesisClient in the Registry with proxies and relevant credentials configured.
Batch Consumer 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
This component implements the Batch Consumer.
This allows you for instance to know how many messages exists in this batch and for instance let the Aggregator aggregate this number of messages.
Message headers set by the Kinesis consumer 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Header
|
Type
|
Description
|
---|---|---|
CamelAwsKinesisSequenceNumber
|
String
|
The sequence number of the record. This is represented as a String as it size is not defined by the API. If it is to be used as a numerical type then use
|
CamelAwsKinesisApproximateArrivalTimestamp
|
String
|
The time AWS assigned as the arrival time of the record.
|
CamelAwsKinesisPartitionKey
|
String
|
Identifies which shard in the stream the data record is assigned to.
|
AmazonKinesis configuration 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You will need to create an instance of AmazonDynamoDBStreamsClient and bind it to the registry
Providing AWS Credentials 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
It is recommended that the credentials are obtained by using the DefaultAWSCredentialsProviderChain that is the default when creating a new ClientConfiguration instance, however, a different AWSCredentialsProvider can be specified when calling createClient(...).
Dependencies 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Maven users will need to add the following dependency to their pom.xml.
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-aws</artifactId> <version>${camel-version}</version> </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws</artifactId>
<version>${camel-version}</version>
</dependency>
where
${camel-version
} must be replaced by the actual version of Camel (2.17 or higher).