redlsz opened a new issue, #8077: URL: https://github.com/apache/rocketmq/issues/8077
### Before Creating the Enhancement Request - [X] I have confirmed that this should be classified as an enhancement rather than a bug/feature. ### Summary There may be certain issues with the org.apache.rocketmq.proxy.service.route.MessageQueueSelector when selecting write queue by filters. 1. The intention of #selectOneMessageQueue is traversing each candidate queue until find eligible one, but this index can be increased concurrently by multiple threads. Therefore, in one traversal, some queues may be accessed more than one time, while some others may not be accessed. <img width="1361" alt="image" src="https://github.com/apache/rocketmq/assets/103550934/1128cfea-9239-4f13-a0f0-47d450dc83a9"> 2. The #transferQueue2Addressable doesn't traverse brokerActingQueues. So if select by onlyBroker=true, the transferred result is always null. <img width="816" alt="image" src="https://github.com/apache/rocketmq/assets/103550934/91e62fe8-3c44-4c3f-9e8f-999697597696"> ### Motivation Make proxy MessageQueueSelector work as expected. ### Describe the Solution You'd Like 1. Add new MessageQueueReadSelector to extend MessageQueueSelector, using ThreadLocalIndex as write selector index. 2. Remove unnecessary transferring between MessageQueue and AddressableMessageQueue. ### Describe Alternatives You've Considered / ### Additional Context _No response_ -- 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: commits-unsubscr...@rocketmq.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org