coderbruis opened a new issue, #11654:
URL: https://github.com/apache/rocketmq/issues/11654

   ## Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in 
GitHub Discussions.
   - [x] I have searched the GitHub Issues and GitHub Discussions of this 
repository and believe that this is not a duplicate.
   - [x] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   ## Runtime platform environment
   
   macOS 26.7.1
   
   ## RocketMQ version
   
   Branch: `develop`
   Git commit: `19352a24679337276e041f67307c6d284dd48de9`
   
   ## JDK Version
   
   OpenJDK 1.8.0_322
   
   ## Describe the Bug
   
   When a message on `%RETRY%{group}` is sent with a plain `SEND_MESSAGE` 
request and is moved to the DLQ, `SendMessageProcessor#handleRetryAndDLQ` 
records `rocketmq_send_to_dlq_messages_total` with:
   
   - `consumer_group` = `requestHeader.getProducerGroup()`
   - `topic` = `requestHeader.getTopic()`
   
   On this path the request is sent by the client's inner producer, so the 
labels become `consumer_group="CLIENT_INNER_PRODUCER"` and 
`topic="%RETRY%{group}"`, instead of the real consumer group and the original 
topic.
   
   The other DLQ path (`CONSUMER_SEND_MSG_BACK`, 
`AbstractSendMessageProcessor`) records the same metric with 
`requestHeader.getGroup()` and `requestHeader.getOriginTopic()`. Both were 
introduced in #5702. The two paths are inconsistent.
   
   This path is reached when:
   1. An orderly consumer with an explicit `maxReconsumeTimes` exhausts its 
retries (`ConsumeMessageOrderlyService#sendMessageBack`).
   2. A concurrent consumer falls back to `sendMessageBackAsNormalMessage` 
because `consumerSendMsgBack` failed (e.g. broker timeout).
   3. Logical queues are used, where the client always takes the fallback path.
   
   The message itself is delivered to the correct `%DLQ%{group}`. Only the 
metric labels are wrong.
   
   ## Steps to Reproduce
   
   1. Start a broker with `metricsExporterType=PROM` (metrics are disabled by 
default).
   2. Start an orderly push consumer `order_cg` subscribing to `TopicOrder`, 
with `setMaxReconsumeTimes(1)`, whose listener always returns 
`SUSPEND_CURRENT_QUEUE_A_MOMENT`.
   3. Send one message to `TopicOrder`.
   4. After the message is moved to `%DLQ%order_cg`, query 
`rocketmq_send_to_dlq_messages_total` from the Prometheus endpoint (default 
port 5557).
   
   ## What Did You Expect to See?
   
   `rocketmq_send_to_dlq_messages_total{consumer_group="order_cg", 
topic="TopicOrder"}` increases by 1.
   
   ## What Did You See Instead?
   
   `rocketmq_send_to_dlq_messages_total{consumer_group="CLIENT_INNER_PRODUCER", 
topic="%RETRY%order_cg"}` increases by 1. Nothing is recorded for `order_cg`, 
so DLQ alerts per consumer group or per topic never fire for these messages.
   
   ## Additional Context
   
   All DLQ messages on this path from every consumer group are aggregated under 
the single label `CLIENT_INNER_PRODUCER`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to