Class AmazonDynamoDBStreamsAdapterClient
java.lang.Object
com.amazonaws.services.dynamodbv2.streamsadapter.AmazonDynamoDBStreamsAdapterClient
- All Implemented Interfaces:
AutoCloseable,software.amazon.awssdk.awscore.AwsClient,software.amazon.awssdk.core.SdkClient,software.amazon.awssdk.services.kinesis.KinesisAsyncClient,software.amazon.awssdk.utils.SdkAutoCloseable
public class AmazonDynamoDBStreamsAdapterClient
extends Object
implements software.amazon.awssdk.services.kinesis.KinesisAsyncClient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum values decides the behavior of application when customer loses some records when KCL lags behind. -
Field Summary
Fields inherited from interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
SERVICE_METADATA_ID, SERVICE_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionAmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider, software.amazon.awssdk.regions.Region region) Recommended constructor forAmazonDynamoDBStreamsAdapterClientwhich takes in the aws credentials and the region where the DynamoDB Stream will be consumed from.protectedAmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient client) AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient dynamoDbStreamsClient, software.amazon.awssdk.regions.Region region) Constructor forAmazonDynamoDBStreamsAdapterClientin which a customDynamoDbStreamsClientcan be passed. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()CompletableFuture<software.amazon.awssdk.services.kinesis.model.DescribeStreamResponse>describeStream(software.amazon.awssdk.services.kinesis.model.DescribeStreamRequest describeStreamRequest) Fetches all the available Shards for a stream using the provided request from the DynamoDB Streams.software.amazon.awssdk.services.kinesis.model.DescribeStreamResponsedescribeStreamWithFilter(String streamArn, software.amazon.awssdk.services.dynamodb.model.ShardFilter shardFilter, String consumerId) getDynamoDBStreamsRecords(software.amazon.awssdk.services.dynamodb.model.GetRecordsRequest ddbGetRecordsRequest) CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetRecordsResponse>getRecords(software.amazon.awssdk.services.kinesis.model.GetRecordsRequest getRecordsRequest) Gets records using the provided request .This method is not supported by the DynamoDB Streams adapter.CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetShardIteratorResponse>getShardIterator(software.amazon.awssdk.services.kinesis.model.GetShardIteratorRequest getShardIteratorRequest) Gets a shard iterator using the provided request from DynamoDB Streams.CompletableFuture<software.amazon.awssdk.services.kinesis.model.ListStreamsResponse>listStreams(software.amazon.awssdk.services.kinesis.model.ListStreamsRequest listStreamsRequest) Lists streams using the provided request from DynamoDB Streams.software.amazon.awssdk.services.kinesis.KinesisServiceClientConfigurationvoidsetSkipRecordsBehavior(AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior) Sets a value ofAmazonDynamoDBStreamsAdapterClient.SkipRecordsBehaviorto decide how the application handles the case when records are lost.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
addTagsToStream, addTagsToStream, createStream, createStream, decreaseStreamRetentionPeriod, decreaseStreamRetentionPeriod, deleteResourcePolicy, deleteResourcePolicy, deleteStream, deleteStream, deregisterStreamConsumer, deregisterStreamConsumer, describeAccountSettings, describeAccountSettings, describeLimits, describeLimits, describeLimits, describeStream, describeStreamConsumer, describeStreamConsumer, describeStreamSummary, describeStreamSummary, disableEnhancedMonitoring, disableEnhancedMonitoring, enableEnhancedMonitoring, enableEnhancedMonitoring, getRecords, getResourcePolicy, getResourcePolicy, getShardIterator, increaseStreamRetentionPeriod, increaseStreamRetentionPeriod, listShards, listShards, listStreamConsumers, listStreamConsumers, listStreamConsumersPaginator, listStreamConsumersPaginator, listStreams, listStreams, listStreamsPaginator, listStreamsPaginator, listStreamsPaginator, listTagsForResource, listTagsForResource, listTagsForStream, listTagsForStream, mergeShards, mergeShards, putRecord, putRecord, putRecords, putRecords, putResourcePolicy, putResourcePolicy, registerStreamConsumer, registerStreamConsumer, removeTagsFromStream, removeTagsFromStream, splitShard, splitShard, startStreamEncryption, startStreamEncryption, stopStreamEncryption, stopStreamEncryption, subscribeToShard, subscribeToShard, tagResource, tagResource, untagResource, untagResource, updateAccountSettings, updateAccountSettings, updateMaxRecordSize, updateMaxRecordSize, updateShardCount, updateShardCount, updateStreamMode, updateStreamMode, updateStreamWarmThroughput, updateStreamWarmThroughput, waiter
-
Constructor Details
-
AmazonDynamoDBStreamsAdapterClient
public AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider, software.amazon.awssdk.regions.Region region) Recommended constructor forAmazonDynamoDBStreamsAdapterClientwhich takes in the aws credentials and the region where the DynamoDB Stream will be consumed from.- Parameters:
credentialsProvider- AWS credentials providerregion- AWS region for the client
-
AmazonDynamoDBStreamsAdapterClient
public AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient dynamoDbStreamsClient, software.amazon.awssdk.regions.Region region) Constructor forAmazonDynamoDBStreamsAdapterClientin which a customDynamoDbStreamsClientcan be passed. For optimal performance, DynamoDB Recommends the base throttling retry delay to 100ms and the max delay to 10000ms.- Parameters:
dynamoDbStreamsClient-region-
-
AmazonDynamoDBStreamsAdapterClient
protected AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient client)
-
-
Method Details
-
serviceName
- Specified by:
serviceNamein interfacesoftware.amazon.awssdk.core.SdkClient
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacesoftware.amazon.awssdk.utils.SdkAutoCloseable
-
describeStream
public CompletableFuture<software.amazon.awssdk.services.kinesis.model.DescribeStreamResponse> describeStream(software.amazon.awssdk.services.kinesis.model.DescribeStreamRequest describeStreamRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException Fetches all the available Shards for a stream using the provided request from the DynamoDB Streams.- Specified by:
describeStreamin interfacesoftware.amazon.awssdk.services.kinesis.KinesisAsyncClient- Parameters:
describeStreamRequest- Container for the necessary parameters to execute the DescribeStream service method on DynamoDB Streams- Returns:
- The response from the DescribeStream service method, adapted for use with the AmazonKinesis model.
- Throws:
software.amazon.awssdk.awscore.exception.AwsServiceExceptionsoftware.amazon.awssdk.core.exception.SdkClientException
-
getShardIterator
public CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetShardIteratorResponse> getShardIterator(software.amazon.awssdk.services.kinesis.model.GetShardIteratorRequest getShardIteratorRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException Gets a shard iterator using the provided request from DynamoDB Streams.- Specified by:
getShardIteratorin interfacesoftware.amazon.awssdk.services.kinesis.KinesisAsyncClient- Parameters:
getShardIteratorRequest- Container for the necessary parameters to execute the GetShardIterator service method on DynamoDB Streams.- Returns:
- The response from the GetShardIterator service method, adapted for use with the AmazonKinesis model.
- Throws:
software.amazon.awssdk.awscore.exception.AwsServiceExceptionsoftware.amazon.awssdk.core.exception.SdkClientException
-
serviceClientConfiguration
public software.amazon.awssdk.services.kinesis.KinesisServiceClientConfiguration serviceClientConfiguration()- Specified by:
serviceClientConfigurationin interfacesoftware.amazon.awssdk.awscore.AwsClient- Specified by:
serviceClientConfigurationin interfacesoftware.amazon.awssdk.services.kinesis.KinesisAsyncClient- Specified by:
serviceClientConfigurationin interfacesoftware.amazon.awssdk.core.SdkClient
-
listStreams
public CompletableFuture<software.amazon.awssdk.services.kinesis.model.ListStreamsResponse> listStreams(software.amazon.awssdk.services.kinesis.model.ListStreamsRequest listStreamsRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException Lists streams using the provided request from DynamoDB Streams.- Specified by:
listStreamsin interfacesoftware.amazon.awssdk.services.kinesis.KinesisAsyncClient- Parameters:
listStreamsRequest- Container for the necessary parameters to execute the ListStreams service method on DynamoDB Streams.- Returns:
- The response from the ListStreams service method, adapted for use with the AmazonKinesis model.
- Throws:
software.amazon.awssdk.awscore.exception.AwsServiceExceptionsoftware.amazon.awssdk.core.exception.SdkClientException
-
getRecords
public CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetRecordsResponse> getRecords(software.amazon.awssdk.services.kinesis.model.GetRecordsRequest getRecordsRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException Gets records using the provided request .This method is not supported by the DynamoDB Streams adapter.- Specified by:
getRecordsin interfacesoftware.amazon.awssdk.services.kinesis.KinesisAsyncClient- Parameters:
getRecordsRequest- Container for the necessary parameters to execute the GetRecords service method on DynamoDB Streams.- Returns:
- The response from the GetRecords service method, adapted for use with the AmazonKinesis model.
- Throws:
software.amazon.awssdk.awscore.exception.AwsServiceExceptionsoftware.amazon.awssdk.core.exception.SdkClientException
-
getDynamoDBStreamsRecords
public CompletableFuture<DynamoDBStreamsGetRecordsResponseAdapter> getDynamoDBStreamsRecords(software.amazon.awssdk.services.dynamodb.model.GetRecordsRequest ddbGetRecordsRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException - Throws:
software.amazon.awssdk.awscore.exception.AwsServiceExceptionsoftware.amazon.awssdk.core.exception.SdkClientException
-
describeStreamWithFilter
-
setSkipRecordsBehavior
public void setSkipRecordsBehavior(AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior) Sets a value ofAmazonDynamoDBStreamsAdapterClient.SkipRecordsBehaviorto decide how the application handles the case when records are lost. Default =AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior.SKIP_RECORDS_TO_TRIM_HORIZON- Parameters:
skipRecordsBehavior- AAmazonDynamoDBStreamsAdapterClient.SkipRecordsBehaviorfor the adapter
-