xiaoyifang opened a new issue, #5729:
URL: https://github.com/apache/rocketmq/issues/5729

   
https://github.com/apache/rocketmq/blob/81e3648e3fcb1995897db3960a4561d6047b696c/client/src/main/java/org/apache/rocketmq/client/common/ThreadLocalIndex.java#L23-L35
   
   this threadLocal variable `threadLocalIndex` is used in many places and used 
to evenly distributed the message.
   
   IMO,I think threadlocal variable may not be a good idea,  a global variable 
should be more suitable.
   
   the threadlocal variable will has no problem especially when distibuting a 
large amount of message . But when the messages amount is small and 
messagequeue is a little bigger , there would be a chance to see the message is 
unevenly distributed.
   
   Why?
   
   
![image](https://user-images.githubusercontent.com/105986/208278330-39b37f18-b988-4606-badd-f02523c72b2b.png)
   
   
   
   I'm not very familiar with the distibution logic , so plz correct me if I'm 
wrong.
   


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

Reply via email to