Moving failed messages back to a source queue can reproduce the original incident at a higher rate. Some messages may already have produced an external effect, while others no longer match the current consumer's schema. Establish why processing failed and what replay is allowed to repeat before starting recovery.
This guide describes an operational replay procedure, with Amazon SQS documentation used for explicitly named service behavior. Examples are synthetic. The procedure also applies as a design checklist for other queues, whose retention, ordering, identity, and redrive semantics need their own verification.
Preserve enough evidence to explain the failure
Record the source and dead-letter queue identities, affected message classes, consumer version, failure interval, and known downstream effects. Keep payload access restricted. An operator usually needs schema version, business operation identity, and sanitized failure classification before needing the full body.
Separate transient dependency failures from invalid data, unsupported schemas, authorization failures, and application defects. A fixed dependency outage may justify retrying unchanged work. A permanently invalid message requires correction or an explicit terminal decision instead of another delivery attempt.
For SQS, the dead-letter queue guide documents receive-count policy and different retention behavior for standard and FIFO queues. Verify the remaining lifetime before investigation consumes the recovery window. A dashboard's oldest-age metric should not be assumed to represent the original business event's age.
Preserve the source of truth needed for reconciliation before messages expire. That may be a durable application operation record rather than a second unrestricted copy of every payload. Define who owns unresolved work and how an expired message will still be identified.
Select work whose processing contract is understood
Define the replay set by cause, schema compatibility, time interval, and business scope. A queue containing several incident classes should not automatically become one recovery batch. Verify that the current consumer supports the selected payloads and that their account mappings remain valid.
Use an isolated fixture to reproduce the original failure and demonstrate the correction. Include an old message version and a record whose referenced resource was deleted. A consumer that no longer crashes may still apply an obsolete instruction to the wrong current state.
Review the queue service's selection capabilities before planning a batch. The SQS message movement API accepts a source, destination, and movement rate, with no request fields for payload filtering or transformation. A selected-subset procedure may therefore need a separately designed recovery tool.
If transformation is required, preserve the relationship between the original operation and its corrected representation. Validate the transformed schema and record why the change is valid. Restrict the recovery tool's destinations so a mistaken identifier cannot publish private messages to an unrelated queue.
Protect the business operation from repeated delivery
Determine what may have completed before each message failed. In a synthetic notification worker, the provider might have accepted a send while the worker failed before recording success. Replaying that message as a fresh operation could produce another notification.
Use durable business operation identities and supported downstream idempotency where the action requires it. SQS standard queue delivery permits duplicates even outside an incident, so duplicate handling belongs in the ordinary consumer path as well as the recovery tool.
Do not use the current transport message identifier as the only business identity. SQS documents that managed redrive assigns new message identifiers and enqueue times. Carry the stable application identity in the processing contract and keep it available across retries and recovery.
Where no reliable idempotency mechanism exists, reconcile the external result before repeating an ambiguous action. An unresolved outcome should remain visible for a documented decision. The guide to idempotent writes provides the distinction between a transport retry and a business action allowed to happen once.
Allocate recovery capacity alongside live traffic
Start with a small verified batch and an explicit maximum replay rate. Budget database connections, downstream calls, worker concurrency, and live-traffic latency together. A low message rate can still overload a dependency if the selected messages require expensive operations.
The SQS redrive guide supports a configurable redrive velocity and recommends starting low while observing the source queue. Messages moved back can interleave with newly produced work, so recovery should not assume restoration of the original business ordering.
Set stop conditions before starting: rising live error rate, repeated failure of the same class, exhausted downstream capacity, or unexplained duplicate effects. Assign an operator or controller to stop the movement and track the task identity.
Stopping a redrive task does not retract work already delivered or cancel effects already accepted by a provider. Define a separate consumer pause or admission boundary when needed, then reconcile the messages already in flight. Avoid treating the movement control as a transaction over all affected systems.
Reconcile outcomes before declaring recovery complete
Track how many selected operations were already complete, successfully recovered, explicitly rejected, still pending, or unresolved. Queue depth alone cannot distinguish successful processing from expiry, deletion, or transfer to another failure destination.
For the synthetic notification incident, compare durable operation records with supported provider evidence. Confirm that the intended recipients have one accepted business operation according to the contract and that ambiguous sends remain assigned for investigation. Do not infer that a drained queue means every recipient received a notification.
Exercise the replay tool's failure paths: lost permission, unavailable destination, process termination, malformed input, and a stop request during active movement. Keep diagnostics sanitized, and verify that retrying the tool does not silently create another independent recovery operation.
After recovery, adjust the original failure boundary. That may mean a consumer compatibility check, better lease handling, a bounded retry policy, or an alert tied to remaining retention. Keep the replay record with the deployed fix and the unresolved cases. Close the incident when the business outcomes are accounted for and normal processing can resume within its documented limits.
Was this guide useful?
Your rating helps us prioritize clearer, more practical technical content.
Review diffs, run checks, and prepare the release in Arezgit.
Keep Git review, security scanning, API checks, database inspection, and release preparation together in one local desktop application.
Explore Arezgit