Respond then continue working with AWS Lambda/API Gateway?

前端 未结 1 699
离开以前
离开以前 2021-02-12 14:28

I currently have a Web hook that\'s calling AWS API Gateway -> AWS Lambda function proxy. I\'d like to make the web hook more responsive and return an early reply while continui

1条回答
  •  感情败类
    2021-02-12 14:41

    API Gateway currently only supports synchronous invocation (aka InvocationType: RequestResponse) of Lambda functions, so yes, it is waiting for the full response from the Lambda.

    To support your use case, you could use SNS or an another intermediary AWS service like Kinesis, SQS, etc. But you could also do it with Lambda alone. Have the first Lambda function trigger a second Lambda function asynchronously with InvocationType: 'Event', this will achieve the effect you desire.

    See this post for more details: https://stackoverflow.com/a/31745774/5705481

    0 讨论(0)
提交回复
热议问题