Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support to "AT_TIMESTAMP" ShardIteratorType #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

M0dM
Copy link

@M0dM M0dM commented Sep 30, 2019

As documented here:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kinesis.html#Kinesis.Client.get_shard_iterator

I think those lines may be enough to support AT_TIMESTAMP behavior.
It is not tested yet.

It should be used this way:

    from kinesis.consumer import KinesisConsumer

    consumer = KinesisConsumer(stream_name='my-stream', start_at_timestamp='20190901')
    for message in consumer:
        print "Received message: {0}".format(message)

Regards,
M0dM

As documented here:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kinesis.html#Kinesis.Client.get_shard_iterator

I think those lines may be enough to support AT_TIMESTAMP behavior.
It is not tested yet.

It should be used this way:
```python3
    from kinesis.consumer import KinesisConsumer

    consumer = KinesisConsumer(stream_name='my-stream', start_at_timestamp='20190901')
    for message in consumer:
        print "Received message: {0}".format(message)
```
Regards,
M0dM
@codecov-io
Copy link

codecov-io commented Sep 30, 2019

Codecov Report

Merging #22 into master will increase coverage by 0.58%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   32.98%   33.56%   +0.58%     
==========================================
  Files           4        4              
  Lines         285      289       +4     
==========================================
+ Hits           94       97       +3     
- Misses        191      192       +1
Impacted Files Coverage Δ
src/kinesis/consumer.py 38.46% <83.33%> (+1.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bf3551...3c526ee. Read the comment docs.

@M0dM
Copy link
Author

M0dM commented Oct 1, 2019

I can confirm the above code is working for me.

Regards,
M0dM

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants