apache / apache/rocketmq

[studio][Bug] Malformed retry counters can abort Proxy message forwarding

Open Beginner friendly
#10,904 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

### Before Creating the Bug Report

- [x] I found a bug, not just a question.
- [x] I searched existing issues and pull requests for malformed reconsumeTimes, maxReconsumeTimes, and PROPERTY_RECONSUME_TIME handling.
- [x] I confirmed the affected code belongs to this repository.

### Describe the Bug

ProducerProcessor#buildSendMessageRequestHeader parses retry-message properties with Integer.valueOf:

- MessageConst.PROPERTY_RECONSUME_TIME
- MessageConst.PROPERTY_MAX_RECONSUME_TIMES

If either stored property is malformed, building the broker request header throws NumberFormatException and the Proxy send/retry path fails. The same method already tolerates a malformed born timestamp by falling back to the current time, but retry counters do not have equivalent defensive handling.

### Expected Behavior

- Preserve the current behavior for valid retry counters.
- Treat a malformed reconsume-times value as the existing default of 0.
- Leave max-reconsume-times unset when its value is malformed.
- Keep clearing the internal retry properties from the message after handling them.
- Add focused tests proving malformed counters do not abort request-header construction.

### Affected Area

RocketMQ Proxy producer/retry message processing used by RocketMQ Studio and gRPC/remoting operational flows.

### Proposed Scope

Keep the change local to ProducerProcessor retry-counter parsing and its unit tests. Do not change public APIs or valid retry-message semantics.

Contributor guide

Open the contributing guide

Research direction

Start with ProducerProcessor#buildSendMessageRequestHeader and trace how PROPERTY_RECONSUME_TIME and PROPERTY_MAX_RECONSUME_TIMES are parsed and cleared. Add focused unit tests for malformed retry counters, then run the relevant ProducerProcessor tests. Done means malformed values no longer abort header construction, while valid counters and existing defaults remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.