Amazon Kinesis Data Streams events.
kinesis = Mayfly.Events.Kinesis.decode(event)
{:ok,
Mayfly.Events.Kinesis.process_batch(kinesis, fn record ->
MyApp.Ingest.handle(record.data)
end)}data is base64-decoded and JSON-decoded when it parses, otherwise the raw
bytes. Partial batch responses use the record's sequence_number; the event
source mapping needs FunctionResponseTypes=ReportBatchItemFailures.
Summary
Functions
Partial batch response for the given sequence numbers.
Decodes a Kinesis event.
Runs fun per record, collecting failures by sequence number.
Types
@type t() :: %Mayfly.Events.Kinesis{ raw: map(), records: [Mayfly.Events.Kinesis.Record.t()] }
Functions
Partial batch response for the given sequence numbers.
Decodes a Kinesis event.
@spec process_batch(t(), (Mayfly.Events.Kinesis.Record.t() -> term())) :: %{ batchItemFailures: [%{itemIdentifier: String.t()}] }
Runs fun per record, collecting failures by sequence number.