I am getting this error while fetching data from Amazon kinesis Stream. I am doing below steps
- creating amazon kinesis Steam
- put the data using
putRecord
api ofAmazonKinesisClient
. - Then using Worker Of KCL library to get the data from stream.
There are a few possibilities.
- After you ordered to create the stream, did you wait long enough for completion? Sometimes, it may took 10 minutes for a shard to be created. Since you managed to use
putRecord
method, the stream and shard should be active. - Did you configure the DynamoDB correctly? I assume you are using it for your Kinesis Application synchronization. See inside the records of the DynamoDB table. Are all columns (ie. leaseKey, checkpoint, leaseOwner, parentShardId etc.) correctly filled? Maybe the data in the database is old, so you may be accessing a closed shard?
The exception you mention is here: https://github.com/awslabs/amazon-kinesis-client/blob/master/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/ShardSyncer.java#L193
Try deleting the DynamoDB table and let the Kinesis Application (KCL) create a brand new one. Link: https://console.aws.amazon.com/dynamodb/
来源:https://stackoverflow.com/questions/27470660/shard-shardid-000000000000-is-not-closed-this-can-happen-if-we-constructed-th