如果 AWS Lambda 函数具有来自多个 Kinesis 流的事件源,那么这批传入记录是来自单个 Kinesis 流还是混合流?

If a AWS Lambda function has event sources from multiple Kinesis streams, will the batch of incoming records be from a single Kinesis stream or a mix?

标题可能有点混乱。我会尽力让它更清楚。

假设我有一个 AWS Lambda 函数,它有两个不同的 Kinesis 流 A 和 B 作为输入事件源。

因此,对于以下内容,由于 KinesisEvent 实例包含一批记录,该批次将包含来自单个流的记录,还是本质上它包含来自流 A 和 B 的记录?

public class ProcessKinesisEvents {
    public void recordHandler(KinesisEvent event, Context context) {
        ...
    }
}

相应地AWS Kinesis stream and an AWS Lambda function is a dedicated entity resulting from a call to CreateEventSourceMapping and comprised of the EventSourceArn and the FunctionName, for which you also specify a dedicated Batch Size之间的每个映射:

POST /2015-03-31/event-source-mappings/ HTTP/1.1
Content-type: application/json

{
    "BatchSize": number,
    "Enabled": boolean,
    "EventSourceArn": "string",
    "FunctionName": "string",
    "StartingPosition": "string"
}

因此,您将收到的批次仅限于构成响应的单个事件源。映射,并且每个其他事件源将相应地产生对您的 Lambda 函数的单独调用,因此一切都被正确隔离。