xu-weize opened a new issue, #4139:
URL: https://github.com/apache/rocketmq/issues/4139
This method of selectOneMessageQueue question:
Why not traverse all the queues and find that they do not match if (null =
= lastbrokername | MQ. Getbrokername() Equals (lastbrokername)) condition is
not to select an available broker, but to select a pickoneatleast from the
fault delay table?
// code:
public MessageQueue selectOneMessageQueue(final TopicPublishInfo tpInfo,
final String lastBrokerName) {
if (this.sendLatencyFaultEnable) {
try {
int index = tpInfo.getSendWhichQueue().getAndIncrement();
for (int i = 0; i < tpInfo.getMessageQueueList().size();
i++) {
int pos = Math.abs(index++) %
tpInfo.getMessageQueueList().size();
if (pos < 0)
pos = 0;
MessageQueue mq = tpInfo.getMessageQueueList().get(pos);
if
(latencyFaultTolerance.isAvailable(mq.getBrokerName())) {
if (null == lastBrokerName ||
mq.getBrokerName().equals(lastBrokerName))
return mq;
}
}
final String notBestBroker =
latencyFaultTolerance.pickOneAtLeast();
int writeQueueNums =
tpInfo.getQueueIdByBroker(notBestBroker);
}
--
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]