Skip to content

[Enhancement] Enable "useSeparateRetryQueue" for priority topics #10350

@imjyz

Description

@imjyz

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

Add a new global switch to enable useSeparateRetryQueue only for priority topics. This prevents high-priority retry messages from being blocked by accumulated low-priority retry messages, while keeping normal topics unchanged.

新增一个全局开关,只为优先级 Topic 启用useSeparateRetryQueue。这样可以避免高优先级重试消息被大量低优先级重试消息阻塞,同时不影响普通 Topic 的现有行为。

Motivation

RIP-80 introduces priority messages for POP consumption. Priority messages are routed to different queues by priority, so consumers can process high-priority messages before low-priority messages.

RIP-80 为 POP 消费引入了优先级消息。消息会按优先级路由到不同队列,消费者可以优先消费高优先级消息。

However, once messages enter the retry topic, this priority can be lost. For example, a retry queue may contain:

但是,当消息进入 retry topic 后,优先级可能会失效。例如,retry queue 中可能出现:

| low | low | low | low | low | high |

The high-priority retry message has to wait for all earlier low-priority retry messages. This causes priority inversion in the retry topic.

高优先级重试消息必须等待前面的低优先级重试消息消费完成,导致 retry topic 中出现优先级反转。

Describe the Solution You'd Like

Add a new global switch that enables useSeparateRetryQueue only for priority topics.

新增一个全局开关,只为优先级 Topic 启用useSeparateRetryQueue

Possible config name:

可能的配置名:

useSeparateRetryQueueForPriorityTopic=true

Expected rules:

预期规则:

  1. If broker-level useSeparateRetryQueue=true, keep the current behavior: all topics use separate retry queues.
  2. If useSeparateRetryQueue=false and useSeparateRetryQueueForPriorityTopic=true, only priority topics use separate retry queues.
  3. Normal topics are unchanged unless useSeparateRetryQueue is enabled.

  1. 如果 Broker 级 useSeparateRetryQueue=true,保持现有行为:所有 Topic 使用独立 retry queue。
  2. 如果 useSeparateRetryQueue=falseuseSeparateRetryQueueForPriorityTopic=true,只有优先级 Topic 使用独立 retry queue。
  3. 普通 Topic 行为保持不变,除非开启 useSeparateRetryQueue

Describe Alternatives You've Considered

Deploy priority topics in a separate RocketMQ cluster and enable useSeparateRetryQueue for that cluster.

把优先级 Topic 拆分到独立的 RocketMQ 集群中,并在该集群开启 useSeparateRetryQueue

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions