aaron-ai commented on code in PR #4674:
URL: https://github.com/apache/rocketmq/pull/4674#discussion_r932876556
##########
client/src/main/java/org/apache/rocketmq/client/impl/producer/TopicPublishInfo.java:
##########
@@ -69,19 +69,18 @@ public void setHaveTopicRouterInfo(boolean
haveTopicRouterInfo) {
public MessageQueue selectOneMessageQueue(final String lastBrokerName) {
if (lastBrokerName == null) {
return selectOneMessageQueue();
- } else {
- for (int i = 0; i < this.messageQueueList.size(); i++) {
- int index = this.sendWhichQueue.incrementAndGet();
- int pos = Math.abs(index) % this.messageQueueList.size();
- if (pos < 0)
- pos = 0;
- MessageQueue mq = this.messageQueueList.get(pos);
- if (!mq.getBrokerName().equals(lastBrokerName)) {
- return mq;
- }
+ }
+ for (int i = 0; i < this.messageQueueList.size(); i++) {
+ int index = this.sendWhichQueue.incrementAndGet();
+ int pos = Math.abs(index) % this.messageQueueList.size();
+ if (pos < 0)
+ pos = 0;
Review Comment:
```suggestion
if (pos < 0) {
pos = 0;
}
```
--
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]