Kinesis Firehose如何调用Lambda

时间:2018-12-19 17:05:43

标签: aws-lambda amazon-kinesis-firehose

来自文档:

“然后,Kinesis Data Firehose使用AWS Lambda同步调用模式与每个缓冲的批次异步调用指定的Lambda函数。”

如果firehose以同步模式调用lambda,它又如何异步调用?

1 个答案:

答案 0 :(得分:0)

Firehose异步调用Lambda函数,这意味着Firehose将在必要时使用许多并发的Lambda调用来处理数据流。在同步模式下调用Lambda函数意味着Firehose将等待Lambda返回响应

当然,Firehose必须等待响应。否则它将无法将转换后的数据流传递到S3或任何存储系统。 AWS仅在此处提供额外的详细信息,但以使用“同步”和“异步”来描述相同的机制为代价。

根据本文档https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html

--invocation-type (string)

Choose from the following options.

    RequestResponse (default) - Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.
    Event - Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if it's configured). The API response only includes a status code.
    DryRun - Validate parameter values and verify that the user or role has permission to invoke the function.

因此,您可以想象Firehose在调用Lambda API时会包含参数--invocation-type RequestResponse