You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/01/17 07:08:06 UTC

[GitHub] alaric27 commented on issue #686: MQFaultStrategy optimize

alaric27 commented on issue #686: MQFaultStrategy optimize
URL: https://github.com/apache/rocketmq/pull/686#issuecomment-455065132
 
 
   > Why should this code be moved? IMO, if the message was sent to the message queue failed or timeout, it is better to send the message to another message queue, otherwise, there's a big possibility to send the message to the queue failed again.
   
    if (latencyFaultTolerance.isAvailable(mq.getBrokerName())) {
        if (null == lastBrokerName || mq.getBrokerName().equals(lastBrokerName))
            return mq;
    }
   这段代码的逻辑是:如果之前没有失败过lastBrokerName为空,或则当前选择MessageQueue的brokerName等于上次失败的brokerName,则返回当前MessageQueue。
   这逻辑是有问题的,我认为如果选择的MessageQueue的broker是可用的就可以直接返回。
   而且根据notBestBroker选择MessageQueue,这段处理逻辑是否有必要?我认为如果循环messageQueueList没有找到可用的MessageQueue,直接调用tpInfo.selectOneMessageQueue(lastBrokerName) 返回一个MessageQueue即可。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services