Skip to content

Commit

Permalink
[ISSUE #7779] Fix the selectOneMessageQueue to avoid change messageQu…
Browse files Browse the repository at this point in the history
…eue permanently

Co-authored-by: tianyan <tangtianwei.ttw@antgroup.com>
  • Loading branch information
Tcytw and tianyan committed Jan 25, 2024
1 parent 8d2c661 commit f9f5465
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ public MessageQueue selectOneMessageQueue(final TopicPublishInfo tpInfo, final S
if (writeQueueNums > 0) {
final MessageQueue mq = tpInfo.selectOneMessageQueue();
if (notBestBroker != null) {
MessageQueue selectedMessageQueue = new MessageQueue();
selectedMessageQueue.setTopic(mq.getTopic());
selectedMessageQueue.setBrokerName(notBestBroker);
selectedMessageQueue.setQueueId(tpInfo.getSendWhichQueue().incrementAndGet() % writeQueueNums);
return selectedMessageQueue;
return new MessageQueue(mq.getTopic(), notBestBroker, tpInfo.getSendWhichQueue().incrementAndGet() % writeQueueNums);
} else {
return mq;
}
Expand Down

0 comments on commit f9f5465

Please sign in to comment.