Draw delivery and effect separately
In a fictional funds batch, publishing an event, receiving it, and applying its result are three different observations. SQS Standard permits duplicates; use stable operation identity and protect effects. Do not delete a message before confirming the required result.
In SQS batch calls, HTTP 200 can accompany both Successful and Failed entries. Reconcile IDs and handle only failed entries according to their error, without repeating confirmed effects. A new ReceiveMessage supplies another receipt handle: use the most recent one for DeleteMessage.
Success with an old handle might not mean deletion. At handover, show which identifier follows each phase and how a lost acknowledgment is investigated.
Separate queue timers
Delay postpones first availability; visibility timeout temporarily protects work already received. Ninety-second processing with thirty-second visibility can be delivered again: size or extend the interval while retaining idempotency. Heartbeats do not indefinitely renew the twelve-hour maximum window from the ReceiveMessage request; split long work or assess other orchestration.
Individual message timers are unsupported in FIFO, although queue-level delay exists. For long polling, the client HTTP timeout must exceed WaitTimeSeconds. In the exercise, mark send, receive, extension, completion, and deletion on a timeline; identify exactly which timer explains each symptom before increasing every value.
Observe capacity and unresolved work
An empty polling response does not prove absence of backlog. At the in-flight message limit, long polling can stop returning new messages without an OverLimit error. Review received but undeleted work, duration, failures, and acknowledgments.
A DLQ isolates persistently failed messages according to policy; they still represent unresolved work. Before redrive, fix the cause and check earlier effects. For worker sizing, forty seconds of tolerated waiting divided by two seconds per message gives an initial target of twenty messages per worker in the sequential model.
Validate variation and destination limits before increasing concurrency. Reporting should separate drain rate, queue age, and business outcomes.
Validate fanout and publication configuration
When audit and reconciliation need every event, SNS with one SQS queue per consumer supports independent processing. Two consumers on the same queue share work and do not guarantee that per-team copy. Also confirm the agreed format: on an SQS subscription using raw delivery, more than ten attributes can prevent delivery; disabling raw changes the envelope and requires consumer adaptation.
SNS filter changes can take up to fifteen minutes to propagate, so immediate observation does not close validation. For EventBridge, inspect PutEvents results per entry. Publishing to a nonexistent bus can return 200 without counting a failure; include destination existence, rules, and consumer observation in acceptance.
Preserve useful order and prevent feedback loops
S3 notifications can arrive out of order. For PUT or DELETE events on the same key, compare sequencer as a hexadecimal value with normalized lengths; do not use it as global ordering across different keys. In the local model, hexadecimal 10 is later than f even though a naive text comparison suggests otherwise.
If a function reads input files and writes results to the same bucket, an overly broad notification can invoke it again. Separate buckets or restrict the trigger to the input prefix and keep results outside it. A short independent task can fit Lambda; validate duration, dependencies, access, and cost.
The diagram must include every function write, not just the event starting its first execution.
Deliver a failure plan for each integration
Lambda with an SQS event source mapping polls and invokes the function synchronously. Persistent failures need the source queue’s redrive policy; a DLQ configured only for the function’s asynchronous invocation does not replace that mechanism. In contrast, Invoke with InvocationType=Event and a 202 response confirms acceptance for asynchronous processing, not completion of the business effect. Reserve twenty minutes to interpret the synthetic responses below and deliver a matrix with integration, success condition, retry, isolation, owner, and recovery. Include a rejected sample, a duplicate, and a lost acknowledgment. Examples and local results are fictional, with no AWS calls or internal practices of financial institutions. RUN should receive clear limits on what still needs authorized rehearsal.
The model publishes a complete synthetic DeleteMessageBatch result: a and c were deleted; b has transient InternalError; d has request-side ReceiptHandleIsInvalid; e has an unrecognized code. Before running it with Node.js, classify each entry. Worked resolution: preserve a and c, prepare bounded retry for b with a valid handle, repair d’s handle, and investigate e before choosing recovery. Do not interpret SenderFault=false as universal permission for unlimited retries. For the lost acknowledgement, the durable op-42 record says committed: a new delivery should reconcile that result without repeating the effect. If the record is absent, the model marks investigate without concluding that no effect occurred. Change the record and observe the difference. The example implements no transactions, SDK, retries, or real queue. The remaining visibility hour is only the mathematical difference 12−11; latency and further elapsed time reduce what can be requested from the service.
// Synthetic response interpretation only; no queue, SDK, or network calls.
const batch = {
Successful: [{Id: 'a'}, {Id: 'c'}],
Failed: [
{Id: 'b', Code: 'InternalError', SenderFault: false},
{Id: 'd', Code: 'ReceiptHandleIsInvalid', SenderFault: true},
{Id: 'e', Code: 'UnrecognizedExample', SenderFault: false},
],
};
// A deliberately narrow teaching policy, not a complete AWS error catalogue.
const retryIds = batch.Failed.filter(x => !x.SenderFault && x.Code === 'InternalError').map(x => x.Id);
const repairIds = batch.Failed.filter(x => x.SenderFault).map(x => x.Id);
const investigateIds = batch.Failed.filter(x => !retryIds.includes(x.Id) && !repairIds.includes(x.Id)).map(x => x.Id);
const effects = new Map([['op-42', 'committed']]); // Supplied durable observation, not persistence implemented here.
const lostAckAction = effects.get('op-42') === 'committed' ? 'reconcile-without-repeat' : 'investigate';
const laterOnSameKey = (next, previous) => {
const width = Math.max(next.length, previous.length);
return next.toLowerCase().padStart(width, '0') > previous.toLowerCase().padStart(width, '0');
};
const remainingVisibilitySeconds = 12 * 3600 - 11 * 3600; // Arithmetic ceiling only.
console.log(JSON.stringify({retryIds, repairIds, investigateIds, lostAckAction, tenAfterF: laterOnSameKey('10', 'f'), fAfterTen: laterOnSameKey('f', '10'), remainingVisibilitySeconds}));
A batch responds 200, but b appears in Failed. Record the individual failure and prepare b’s recovery while preserving confirmed results.
Common pitfalls
Confusing 200 or 202 with completion; using an old handle; extending visibility without limit; applying asynchronous configuration to SQS polling.
Related topics: Queues, ordering, and partial failures · Events: permissions, capacity, and costs · Databases, replicas, and cache
A resilient integration observes every boundary and recovers work without assuming acceptance confirmed the effect.
References
- SQS standard queues · AWS documentation consulted 2026-09-29
- DeleteMessageBatch · SAA-C03 / primary documentation consulted 2026-10-04
- SendMessageBatch · SAA-C03 / primary documentation consulted 2026-10-04
- DeleteMessage · SAA-C03 / primary documentation consulted 2026-10-04
- SQS timely processing · SAA-C03 / primary documentation consulted 2026-10-04
- SQS delay queues · SAA-C03 / primary documentation consulted 2026-10-04
- SQS message timers · SAA-C03 / primary documentation consulted 2026-10-04
- Long polling setup · SAA-C03 / primary documentation consulted 2026-10-04
- Visibility timeout · SAA-C03 / primary documentation consulted 2026-10-04
- SNS raw delivery · SAA-C03 / primary documentation consulted 2026-10-04
- SNS subscription filter policies · SAA-C03 / primary documentation consulted 2026-10-04
- EventBridge PutEvents · SAA-C03 / primary documentation consulted 2026-10-04
- S3 event structure · SAA-C03 / primary documentation consulted 2026-10-04
- S3 events and Lambda · SAA-C03 / primary documentation consulted 2026-10-04
- SQS event source configuration · SAA-C03 / primary documentation consulted 2026-10-04
- Lambda with SQS · SAA-C03 / primary documentation consulted 2026-10-04
- Asynchronous Lambda invocation · SAA-C03 / primary documentation consulted 2026-10-04
- SQS dead-letter queues · SAA-C03 / primary documentation consulted 2026-10-04
- SNS to SQS fanout · SAA-C03 / primary documentation consulted 2026-10-04
- Scaling by SQS backlog · SAA-C03 / primary documentation consulted 2026-10-04
- SAA-C03 domain 2 · SAA-C03 / primary documentation consulted 2026-10-04
- SAA-C03 domain 3 · SAA-C03 / primary documentation consulted 2026-10-04