All Products
Search
Document Center

ApsaraMQ for RocketMQ:Retry policies and dead-letter queues

Last Updated:Aug 14, 2023

This topic describes the retry policies and dead-letter queues that are supported by the Message Integration module.

Retry policies

A retry policy specifies the method that is used to retry the messages that failed to be sent. Message Integration supports the backoff retry and exponential decay retry policies.

  • Backoff retry: A failed message can be retried for up to three times. The interval between two consecutive retries is a random value that ranges from 10 to 20 seconds. This is the default retry policy.
  • Exponential decay retry: A failed message can be retried for up to 176 times. The interval between two consecutive retries exponentially increases to a maximum of 512 seconds. The total amount of time that can be used for retries is one day. The specific intervals are 1 second, 2 seconds, 4 seconds, 8 seconds,16 seconds, 32 seconds, 64 seconds, 128 seconds, 256 seconds, and 512 seconds. The value 512 seconds is used for 167 retries.

Fault tolerance policies

A fault tolerance policy specifies the method that is used to handle errors. Message Integration supports the following fault tolerance policies:

  • Fault tolerance allowed: allows fault tolerance. If an error occurs, event processing is not blocked. If a message fails to be sent after the specified maximum number of retries is reached, the message is delivered to the dead-letter queue or discarded.
  • Fault tolerance prohibited: does not allow fault tolerance. If an error occurs in a message and the message fails to be sent after the specified maximum number of retries is reached, event processing is blocked. In this case, the status of the task is automatically changed to Ready.
Note If retries cannot be performed due to errors such as invalid resource configurations, the status of the task is automatically changed to Start Failed.

Dead-letter queues

A dead-letter queue takes effect in a task. If a message fails to be processed or sent after the maximum number of retries specified by the retry policy is reached, the raw message data is sent to the dead-letter queue. By default, the dead-letter queue feature is disabled.
Note Only queues in ApsaraMQ for RocketMQ and MNS can be used as dead-letter queues.