Adding attributes to failed messages being moved to DLQ using SQS Lambda trigger

2

When I use Lambda trigger from CloudWatch/EventBridge rules, if the message eventually fails and gets send to a DLQ, the message receives extra attributes, more specifically RequestID, ErrorCode and ErrorMessage.

I would like to have that same behaviour when using SQS Lambda triggers. Is there any way to do that?

If that is not possible, it would be a great addition to SQS, especially if we could do that along with ReportBatchItemFailures by adding the extra metadata for each message.

{ 
  "batchItemFailures": [ 
        {
            "itemIdentifier": "id1",
            "messageAttributes": {
                "RequestId": { "StringValue": "<some-uuid>" }
            }
        }
    ]
}
asked 4 months ago106 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions