An AWS CloudFormation template by using the AWS::ServerlessRepo::Application resource, as described in the documentation.The Serverless Framework, as described by Yan Cui in this blog post.Then, configure the application with the default SQS parameters and the replay feature parameters. Select “ amazon-sqs-dlq-replay-backoff” application in the public applications repository. The Lambda console: choose the “Browse serverless app repository” option to create a function.You can use this serverless application via: Raise MaxAttempsError(replay=nbReplay, max=config.MAX_ATTEMPS)Īttributes.update()ī = backoff.ExpoBackoffFullJitter(base=config.BACKOFF_RATE, cap=config.MESSAGE_RETENTION_PERIOD)ĭelaySeconds = b.backoff(n=int(nbReplay)) Finally it updates the retry counter, adds a new message timer to the message, and it sends the message back (replays) to the main queue. If not, the function uses the AWS Lambda event data to build a new message for the Amazon SQS main queue. If it exceeds the maximum, the message is moved to the human operated queue. The number of retries is compared to the maximum number (defined in the application configuration file). The replay code uses an SQS message attribute `sqs-dlq-replay-nb` as a persistent counter for the current number of retries attempted. If the message exceeds this limit, the message is moved to a second DLQ where an operator processes it manually.Įach time the SQS dead-letter queue receives a message, it triggers Lambda to run the replay function.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |