Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Kinesis component supports receiving messages from and sending messages to Amazon Kinesis service.

Info
titlePrerequisites

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

...

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 latestTRIM_HORIZON, LATEST, AFTER_SEQUENCE_NUMBER or AT_SEQUENCE_NUMBER. See http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html for descriptions of these two iterator types.

sequenceNumbernullConsumerThe sequence number to start polling from. Required if iteratorType is set to AFTER_SEQUENCE_NUMBER or AT_SEQUENCE_NUMBER
Info
titleRequired Kinesis component options

You have to provide the amazonKinesisClient in the Registry with proxies and relevant credentials configured.

...

You will need to create an instance of AmazonDynamoDBStreamsClient and AmazonKinesisClient and bind it to the registry

Code Block
languagejava
ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost("http://myProxyHost");
clientConfiguration.setProxyPort(8080);

Region region = Region.getRegion(Regions.fromName(region));
region.createClient(AmazonDynamoDBStreamsClientAmazonKinesisClient.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.

Code Block
languagejava
from("aws-kinesis://mykinesisstream?amazonKinesisClient=#kinesisClient")
  .to("log:out?showAll=true");

Providing AWS Credentials

...