AWS Lambda w/ SQS trigger, SQS Lambda Destinations, never adds to destination queue

后端 未结 1 1967
广开言路
广开言路 2021-01-01 05:10

I have a simple lambda function that is triggered from a SQS queue and I\'m using the new Lambda Destinations functionality.

It is set up to trigger

1条回答
  •  执笔经年
    2021-01-01 05:57

    Destinations will not be triggered if you invoke the Lambda function synchronously. You can read this article to get a better idea.

    The primary use case of Destinations is to know about the async execution results of Lambda functions, primarily to get more visibility into the execution details like request and response contexts, payloads, exception stack traces etc. So if a Lambda was invoked synchronously (say, using cli or via an SQS trigger), no messages will be delivered to the Destinations endpoints.

    When you used the CLI you would have used aws lambda invoke-async. Instead if you use aws lambda invoke (which executes Lambda synchronously), you will see the same problems, your destination endpoints will not receive the message.

    You can keep your Destinations endpoints still as SQS (you will see a working example in the article above), but your Lambda trigger will have to change to an asynchronous one.

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