All concepts
Reliability

Redrive Policies

Send messages from a DLQ back to the source queue once the bug is fixed.

Why it matters

Without redrive, you'd have to manually re-publish every dead-lettered message. Redrive automates the round-trip.

Redrive policy (source → DLQ)

A redrive policy on the source queue specifies which DLQ receives failed messages and the maxReceiveCount threshold. This is configured at queue creation or via SetQueueAttributes.

  • deadLetterTargetArn: ARN of the DLQ.
  • maxReceiveCount: receives before dead-lettering.

Redrive allow policy (DLQ permissions)

Defined on the DLQ itself. Controls which source queues are permitted to use this queue as their dead-letter queue.

  • Default: allow all source queues.
  • byQueue: allowlist up to 10 specific source queue ARNs.
  • denyAll: queue cannot be used as a DLQ.

DLQ redrive (DLQ → destination)

Dead-letter queue redrive moves messages from a DLQ to a destination queue — typically the original source queue, but any same-type queue works (FIFO → FIFO). Use StartMessageMoveTask, ListMessageMoveTasks, and CancelMessageMoveTask APIs.

  • Redrive velocity: system-optimized or custom (max 500 msg/sec).
  • Task runs up to 36 hours; max 100 active redrive tasks per account.
  • Redriven messages get new messageId and enqueueTime; retention resets.

Ordering during redrive

Messages are redriven oldest-first from the DLQ, but the destination queue ingests redriven and new messages in receive order. For FIFO, redriven messages may interleave with new producer messages.

Permissions

Redrive requires sqs:StartMessageMoveTask, ReceiveMessage, DeleteMessage on the DLQ and sqs:SendMessage on the destination. For SSE-KMS queues, kms:Decrypt and kms:GenerateDataKey are also required.

Gotchas
  • !If the underlying bug isn't fixed, redriving just sends messages straight back to the DLQ — sometimes faster than before.
  • !Start with a low custom redrive velocity and ramp up to avoid overwhelming recovered consumers.
  • !SQS does not support filtering or modifying messages during redrive.
  • !FIFO DLQ redrive replaces deduplication ID with original message ID to avoid dedup collisions.