All Products
Search
Document Center

ApsaraMQ for RocketMQ:Retry policies and dead-letter queues

Last Updated:Mar 11, 2026

When a message fails to be delivered in a Message Integration task, the system automatically retries delivery. If all retry attempts are exhausted, the message is sent to a dead-letter queue or discarded, depending on the fault tolerance policy. Retry policies and dead-letter queues work together to balance message reliability against delivery throughput.

How it works

When a message delivery fails, the system applies the configured retry policy. The outcome depends on both the retry policy and the fault tolerance policy:

Message delivery fails
        |
        v
  Retry policy applied
  (backoff or exponential decay)
        |
        |-- Retry succeeds --> Message delivered
        |
        +-- All retries exhausted
                |
                v
        Fault tolerance policy
                |
                |-- Allowed
                |       |
                |       |-- Dead-letter queue enabled --> Raw data sent to DLQ
                |       |
                |       +-- Dead-letter queue disabled --> Message discarded
                |
                +-- Prohibited --> Task blocked (status: Ready)

Retry policies

A retry policy controls how many times the system retries a failed message and how long it waits between attempts. Message Integration supports two retry policies.

Backoff retry (default)

The system retries a failed message up to 3 times. Each retry interval is a random value between 10 and 20 seconds.

Use backoff retry when transient failures are likely to resolve quickly and a small number of retries is sufficient.

Exponential decay retry

The system retries a failed message up to 176 times over a maximum period of 1 day. The retry interval doubles after each attempt, starting at 1 second and capping at 512 seconds:

AttemptRetry interval
11 second
22 seconds
34 seconds
48 seconds
516 seconds
632 seconds
764 seconds
8128 seconds
9256 seconds
10-176512 seconds

After the interval reaches 512 seconds, it stays at 512 seconds for the remaining 167 retries.

Use exponential decay retry when failures may take longer to resolve, such as downstream service outages or temporary resource unavailability.

Choose a retry policy

ScenarioRecommended policyReason
Transient network errors or brief service hiccupsBackoff retry (default)Resolves quickly with minimal retries
Downstream service outages or extended unavailabilityExponential decay retryProvides sustained retries over a longer period without overwhelming the target

Fault tolerance policies

A fault tolerance policy determines what happens after all retry attempts are exhausted. Message Integration supports two fault tolerance policies.

Fault tolerance allowed

If a message still fails after the maximum number of retries, the system delivers the raw data to the dead-letter queue (if enabled) or discards the message. Other messages continue to flow normally.

Fault tolerance prohibited

If a message still fails after the maximum number of retries, message processing is blocked. The task status changes to Ready.

Note

If retries cannot be performed due to invalid resource configurations, the task status changes to Startup Failed instead of Ready.

Choose a fault tolerance policy

ScenarioPolicyBehavior after retries exhausted
Partial message loss is acceptable, and remaining messages must keep flowingFault tolerance allowedFailed message goes to DLQ or is discarded; other messages continue
Every message must be delivered, even if it means blocking until the issue is resolvedFault tolerance prohibitedTask is blocked until the issue is resolved

Dead-letter queues

A dead-letter queue (DLQ) takes effect in a task. If a message fails to be delivered after all retry attempts are exhausted, the system sends the raw data to the dead-letter queue.

Dead-letter queues are disabled by default. To preserve undeliverable messages, enable a dead-letter queue in the task configuration.

Supported queue types

The following services can serve as dead-letter queues:

  • ApsaraMQ for RocketMQ

  • Simple Message Queue (formerly MNS)

  • ApsaraMQ for Kafka

  • Event buses in EventBridge

Configuration summary

SettingOptionsDefault
Retry policyBackoff retry, Exponential decay retryBackoff retry
Fault tolerance policyAllowed, Prohibited-
Dead-letter queueEnabled, DisabledDisabled