A Node.js Lambda function processes SQS messages. You need to ensure that when a message fails processing, it is retried with increasing delay, but also that it doesn’t loop forever on unrecoverable errors. Which option best matches this requirement?

Answer

Configure Lambda event source mapping with a DLQ and set maxReceiveCount; throw an error for transient failures and a different error type for unrecoverable failures

Explanation

SQS + Lambda event source mapping uses maxReceiveCount to move poison messages to DLQ, preventing infinite retries. Application logic can classify transient vs unrecoverable errors by what it throws.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error

Related questions

A microservice receives HTTP requests through an ALB to ECS tasks. The service must support blue/green deployments while keeping sessions consistent. Which combination is most suitable for minimizing disruption and maintaining user experience?

View question →

In a Lambda function integrated with DynamoDB, you currently use UpdateItem with an unconditional update expression. Under concurrent updates to the same item, you frequently lose increments. You need to preserve correctness without serializing requests at the application layer. What is the best fix?

View question →

In a Java-based AWS Lambda service, you discover that an API sometimes returns 500 errors only during traffic spikes. You want to improve resilience without changing API contracts. Which combination of changes best addresses transient backend failures while preserving ordering constraints per client?

View question →

You are designing a REST API with API Gateway + Lambda + DynamoDB. For a write path, multiple items share a partition key, and clients expect “exactly-once effect” semantics even when network timeouts occur. Which approach is most appropriate?

View question →

You are building an event-driven system with EventBridge rules that route domain events to different Lambda targets. Some events must be delivered to multiple services, while others must not be duplicated across replays. Which configuration strategy best satisfies both requirements?

View question →

A team wants to implement secure access to an AWS App Runner service via JWT-based authorization from a custom domain. They need to validate tokens and pass identity to the backend without embedding secrets in the container. Which approach is best?

View question →

QuestionBack to list