Willhow-Gao commented on code in PR #8056:
URL: https://github.com/apache/rocketmq/pull/8056#discussion_r1591230018


##########
client/src/main/java/org/apache/rocketmq/client/impl/producer/TopicPublishInfo.java:
##########
@@ -83,7 +83,7 @@ private MessageQueue selectOneMessageQueue(List<MessageQueue> 
messageQueueList,
 
         if (filter != null && filter.length != 0) {
             for (int i = 0; i < messageQueueList.size(); i++) {
-                int index = Math.abs(sendQueue.incrementAndGet() % 
messageQueueList.size());
+                int index = sendQueue.incrementAndGet() % 
messageQueueList.size();

Review Comment:
   > 这是一个线程local int,用完会再从0开始,不能去掉吧
   在同一个类里,也看到了去掉math.abs的用法,应该是确定可以去掉吧,不然下面的方法就会出bug了
   <img width="547" alt="image" 
src="https://github.com/apache/rocketmq/assets/65004897/f409d145-5c4f-4d8b-9f87-f1ccfda09b98";>
   



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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to