All Products
Search
Document Center

ApsaraMQ for RabbitMQ:Message timeout and retry

Last Updated:Feb 01, 2024

This topic describes the default message retry mechanism that is used by ApsaraMQ for RabbitMQ brokers. This helps you understand how failed messages are processed and select a message processing policy that meets your business requirements.

Message retry mechanism

A default message retry mechanism is configured on ApsaraMQ for RabbitMQ brokers. You cannot disable the retry mechanism or configure a new retry mechanism on consumer clients. The following items describe the default message retry mechanism on ApsaraMQ for RabbitMQ brokers:

  • The message retry mechanism can be triggered only if you enable message consumption on consumer clients.

  • If you enable message consumption on a consumer client, the message retry mechanism is triggered if a message fails to be consumed. Message consumption is considered failed if the consumer client does not acknowledge the message within the retry interval.

    • Retry intervals for instances of different editions:

      • Serverless Edition instance: 5 minutes

      • Professional Edition instance: 1 minute

      • Enterprise Edition instance: 5 minutes

      • Enterprise Platinum Edition instance: 30 minutes

    • If a message is successfully consumed by the consumer client during retries, the broker immediately stops retrying the message.

    • A message can be retried up to 16 times. If a message still fails to be consumed after it is retried 16 times, the system stops retrying the message. In this case, you can use one of the following methods to handle the message:

      • Discard the message: If you do not configure a dead-letter exchange for the queue to which the message belongs, the message is discarded.

      • Send the message to a dead-letter exchange: If you configure a dead-letter exchange for the queue to which the message belongs, the message is sent to the dead-letter exchange and then routed to the dead-letter queue based on the routing key and binding key. You can query and export messages in a dead-letter queue. For information about how to configure a dead-letter exchange, see Dead-letter exchanges.