Polling and stream starting positions in Lambda
The StartingPosition parameter tells Lambda when to start reading messages from your stream. There are three options to choose from:
-
Latest – Lambda starts reading just after the most recent record in the Kafka topic.
-
Trim horizon – Lambda starts reading from the last untrimmed record in the Kafka topic. This is also the oldest record in the topic.
-
At timestamp – Lambda starts reading from a position defined by a timestamp, in Unix time seconds. Use the StartingPositionTimestamp parameter to specify the timestamp.
Stream polling during an event source mapping create or update is eventually consistent:
-
During event source mapping creation, it may take several minutes to start polling events from the stream.
-
During event source mapping updates, it may take up to 90 seconds to stop and restart polling events from the stream.
This behavior means that if you specify LATEST
as the starting position for the stream, the event
source mapping could miss events during a create or update. To ensure that no events are missed, specify either
TRIM_HORIZON
or AT_TIMESTAMP
.