Expected behavior for AWS Kinesis ShardIteratorType TRIM_HORIZON

后端 未结 2 749
轮回少年
轮回少年 2021-02-14 02:26

Context: I\'m not necessarily referring to a KCL-based application, just pure Kinesis API calls.

Does the using the TRIM_HORIZON shard iter

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 03:03

    it's at the TRIM HORIZON, or the HORIZON where the stream TRIMming happens.

    the shard iterator may get 0 records when called, so you'll need to keep iterating to reach the area where the oldest record is (if you push infrequently to the stream or have time gaps). the getRecords will give you the next shard iterator you can use to iterate.

    from doc: http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html

    If there are no records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains records.

提交回复
热议问题