Aias00 opened a new issue, #10688:
URL: https://github.com/apache/rocketmq/issues/10688
### Bug description
`MessageQueueSelector.buildWrite` parses ordered topic route data from
`TopicRouteWrapper.getOrderTopicConf()` as `brokerName:queueNum` entries
separated by `;`.
The current implementation assumes every entry has both parts and that
`queueNum` is numeric:
```java
String[] item = broker.split(":");
String brokerName = item[0];
int nums = Integer.parseInt(item[1]);
```
If the route data contains a malformed entry such as `broker-a`,
`broker-a:not-a-number`, or an empty broker name, queue selector construction
can throw `ArrayIndexOutOfBoundsException` or `NumberFormatException`. This
makes one bad ordered-route fragment break the whole proxy write queue
selection path.
### Expected behavior
The proxy should tolerate malformed ordered-route fragments. Invalid
fragments should be skipped with a diagnostic warning, while valid fragments in
the same `orderTopicConf` should still be used to build write queues.
### Affected area
`proxy` module, route selection for ordered topic write queues.
### Suggested fix
- Validate each `orderTopicConf` fragment before parsing.
- Skip entries with missing broker name, missing queue count, or non-numeric
queue count.
- Keep existing behavior for valid `brokerName:queueNum` entries.
- Add unit tests for mixed valid and invalid ordered-route fragments.
--
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]