Skip to content

Instantly share code, notes, and snippets.

@ashhadulislam
Created August 19, 2020 14:35
Show Gist options
  • Save ashhadulislam/a8c52ed143aad0bcde502b677e97327a to your computer and use it in GitHub Desktop.
Save ashhadulislam/a8c52ed143aad0bcde502b677e97327a to your computer and use it in GitHub Desktop.
from boto import kinesis
import time
kinesis = kinesis.connect_to_region("us-east-2")
shard_id = 'shardId-000000000000' #we only have one shard!
shard_it = kinesis.get_shard_iterator("end-stream", shard_id, "LATEST")["ShardIterator"]
while 1==1:
out = kinesis.get_records(shard_it, limit=1)
shard_it = out["NextShardIterator"]
# print(out)
if len(out["Records"])>0:
print(out["Records"][0]["Data"])
time.sleep(0.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment