[英]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?
The title might be a bit confusing. 标题可能有点混乱。 I'll try my best to make it clearer. 我会尽力使它更清楚。
Suppose I have a AWS Lambda function that has two different Kinesis streams A and B as input event sources. 假设我有一个AWS Lambda函数,该函数具有两个不同的Kinesis流A和B作为输入事件源。
So, for the below, since a KinesisEvent instance contains a batch of records, will the batch contain records from a single stream, or essentially it contain records from both streams A and B? 那么,对于以下情况,由于KinesisEvent实例包含一批记录,该批处理将包含来自单个流的记录,还是本质上它包含来自流A和B的记录?
public class ProcessKinesisEvents {
public void recordHandler(KinesisEvent event, Context context) {
...
}
}
Each mapping between an 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 accordingly: AWS Kinesis流和AWS Lambda函数之间的每个映射都是一个专用实体,该实体是通过调用CreateEventSourceMapping生成的,并由EventSourceArn和FunctionName组成 ,为此您还可以为其指定专用的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"
}
Consequently, the batches you will receive are constrained to the single event source that constitutes the resp. 因此,您将收到的批次将限制为构成响应的单个事件源。 mapping, and each other event source will yield a separate invocation of your Lambda function accordingly, so everything is properly isolated. 映射,以及每个其他事件源都会相应地对Lambda函数进行单独调用,因此所有内容均已正确隔离。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.