2
votes

From documentation :

"Kinesis Data Firehose then invokes the specified Lambda function asynchronously with each buffered batch using the AWS Lambda synchronous invocation mode."

If firehose invokes lambda in synchronous mode, how its also invoked asynchronously?

1
Can you share the documentation link too?Chetan

1 Answers

0
votes

Firehose invokes the Lambda function asynchronously means that Firehose will use many concurrent Lambda invocations if necessary to process the data stream. The Lambda function is invoked in synchronous mode means that Firehose will wait for Lambda to return a response

Of course Firehose must wait for a response; otherwise it wouldn't be able to deliver the transformed data stream to S3 or whichever storage system. AWS is just providing extra details here at the cost of using "synchronous" and "asynchronous" to describe the same mechanism.

From this document 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.

So you can imagine when Firehose calls the Lambda API, it includes the argument --invocation-type RequestResponse