lwclover commented on issue #4154:
URL: https://github.com/apache/rocketmq/issues/4154#issuecomment-1097467953

   > 
![1649761765(1)](https://user-images.githubusercontent.com/42512469/162947438-82a56beb-a899-4022-a7ee-17f44a65d154.png)
   > 
   > mq.setBrokerName(notBestBroker); 
mq.setQueueId(tpInfo.getSendWhichQueue().getAndIncrement() % writeQueueNums);
   > 
   > this method of selectOneMessageQueue is executed by multiThread when send 
a message but the mq (messageQueue) is a shared object , thread A modify it`s 
brokerName to brokerB,but have not modify it queueId, still 1 , then thread B 
send msg and use this queue,but now,this queue `s brokerName is brokerB but 
it`s queueId is 1, in this case , wo can`t sure that brokerB really have queue 
which queueId is 1
   > 
   > Isn't that really a problem?
   
   I think you are right, to be more precise, constructors should be used.


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