542928492 commented on issue #2223:
URL: https://github.com/apache/rocketmq/issues/2223#issuecomment-668018359


   `Repair plan`
   
     public static MessageQueue selectOneMessageQueue(final String 
lastBrokerName) {
           if (lastBrokerName == null) {
               return selectOneMessageQueue();
           } else {
   
               for (int i = 0; i < messageQueueList.size(); i++) {
                   //repair: move sendWhichQueue to here
                   int index = sendWhichQueue.getAndIncrement();
                   int pos = Math.abs(index) % messageQueueList.size();
                   if (pos < 0)
                       pos = 0;
                   MessageQueue mq = messageQueueList.get(pos);
                   if (!mq.getBrokerName().equals(lastBrokerName)) {
                       return mq;
                   }
               }
               return selectOneMessageQueue();
           }


----------------------------------------------------------------
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.

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


Reply via email to