- 最新
- 最多得票
- 最多評論
Hi,
AWS Lambda does not include the function name in the attributes that are added to the event, see https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq
Lambda sends the event to the dead-letter queue as-is, with additional information in attributes. You can use this information to identify the error that the function returned, or to correlate the event with logs or an AWS X-Ray trace.
Dead-letter queue message attributes
RequestID (String) – The ID of the invocation request. Request IDs appear in function logs. You can also use the X-Ray SDK to record the request ID on an attribute in the trace. You can then search for traces by request ID in the X-Ray console. For an example, see the error processor sample.
ErrorCode (Number) – The HTTP status code.
ErrorMessage (String) – The first 1 KB of the error message.
However, you could implement such logic in your exception handling logic in your Lambda function. Alternatively, you could use a 1:1 mapping between SNS topics and Lambda functions, that way it would always be clear from which function the message originated.
Regards, Ben
Thank you for your answer. I understood your answer. I also want to catch timeout and throttling, so I will try 1:1 mapping between SNS topics and Lambda functions.
Best regards, yyahi
相關內容
- AWS 官方已更新 3 年前
- AWS 官方已更新 1 年前
I cant even get the above to send a message to SNS