I have a lambda function that is triggered by an SQS message. I want to set a retry for the message incase of failure. The thing is, i want this retry to be executed after 5 minutes delay. How can i do that? I'm currently not using a DLQ, but can add one if necessary. The thing is I'm not sure DLQ supports delay messages. I know there's the delayMessage param for SQS, but for my understanding it is set once when putting the message in the queue. And for the original execution i don't want the delay - Only for the retry. Suggestions?
Pssoible solutions i don't want to use-
- sleep within the lambda before raising
- Not sending the same message again to the queue, but a new message with the delayMessage parameter