Skip to content

Commit 950217c

Browse files
Fix ContinuationSequenceNumber in SubscribeToShard
1 parent f068555 commit 950217c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

localstack-core/localstack/services/kinesis/provider.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ def event_generator():
125125
raise
126126
shard_iterator = result.get("NextShardIterator")
127127
records = result.get("Records", [])
128-
if not records:
128+
if records:
129+
# Update the last sequence number to the last record's sequence number
130+
last_sequence_number = records[-1].get("SequenceNumber", last_sequence_number)
131+
else:
129132
# On AWS there is *at least* 1 event every 5 seconds
130133
# but this is not possible in this structure.
131134
# In order to avoid a 5-second blocking call, we make the compromise of 3 seconds.

0 commit comments

Comments
 (0)