Github user Jaskey commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/63
  
    @lizhanhui , # 4 is not the nessary conditions, since even it is not enble, 
the tpInfo's method is still used.
    
                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);
                    if (writeQueueNums > 0) {
                        final MessageQueue mq = tpInfo.selectOneMessageQueue();
                        if (notBestBroker != null) {
                            mq.setBrokerName(notBestBroker);
                            
mq.setQueueId(tpInfo.getSendWhichQueue().getAndIncrement() % writeQueueNums);
                        }
                        return mq;
                    } else {
                        latencyFaultTolerance.remove(notBestBroker);//my npe is 
thrown here
                    }
                } 
    
    
    Besides, if topic route info is null which propably means user is send 
through my seletor method, resend should still respect user's seletor, so 
chosen broker is not enough, the chosen queue is needed, which may be another 
issue, I guess it is not a very minal effort, since the existing interface does 
not record any chosen queue info.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to