This topic describes the default message retry mechanism of the Message Queue for RabbitMQ broker, and how messages that fail to be consumed are processed. Then, you can select a policy to process messages as required.

Message retry mechanism

The Message Queue for RabbitMQ broker has a default message retry mechanism. You cannot disable it or configure a new one on the consumer client. Details about the default message retry mechanism:
  • The message retry mechanism can be triggered only when you enable message consumption on the consumer client.
  • If you enable message consumption on the consumer client, consumption failures trigger message retries. If the consumer client does not acknowledge a message within 1 minute after the message is sent, it is considered that a consumption failure occurred.
    • If the consumer client responds to a message that is retried, the broker immediately stops retrying the message.
    • The retry interval is 60 seconds.
    • A message can be retried up to 16 times. If a message still fails to be consumed after it is retried 16 times, it is discarded or sent to a dead-letter exchange:
      • If you do not configure a dead-letter exchange for the queue of the message, the message is discarded.
      • If you configure a dead-letter exchange for the queue, the message is sent to the dead-letter exchange and then routed to a dead-letter queue based on the routing key and binding key. You can query and export messages from a dead-letter queue. For more information about how to configure a dead-letter exchange, see Dead-letter exchange.