naman bhadani
naman bhadani

Reputation: 43

Understanding AWS lambda retry mechanism

My use case : From the spring-boot application, I am publishing a payload to AWS SNS, this SNS is triggering the Lambda function.

If the lambda function fails, is there any configuration available on AWS lambda where we can specify the number of retries and the duration after which each retry happens?

Upvotes: 3

Views: 611

Answers (2)

luk2302
luk2302

Reputation: 57114

https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html specifies the retry policies for Lambda in case the Lambda service itself is unavailable.

Immediate retry (no delay) phase Pre-backoff phase Backoff phase Post-backoff phase Total attempts
3 times, without delay 2 times, 1 second apart 10 times, with exponential backoff, from 1 second to 20 seconds 100,000 times, 20 seconds apart 100,015 times, over 23 days

And also notes

With the exception of HTTP/S, you can't change Amazon SNS-defined delivery policies. Only HTTP/S supports custom policies. See Creating an HTTP/S delivery policy.

Therefore no, you cannot change the retry behaviour of SNS for Lambda invocations.

There are however two things you can do:

Upvotes: 1

Marcin
Marcin

Reputation: 238139

Sadly, you can't control retry policies as explained in the docs:

With the exception of HTTP/S, you can't change Amazon SNS-defined delivery policies.

Upvotes: 2

Related Questions