sendResult = this.sendKernelImpl(msg, mq, communicationMode, sendCallback, topicPublishInfo, timeout - costTime);
endTimestamp = System.currentTimeMillis();
this.updateFaultItem(mq.getBrokerName(), endTimestamp - beginTimestampPrev, false);
When send message and no exception occurred, method updateFaultItem()
will be executed.But it's an available broker, why add it to the faultItemTable
???
Because success does not mean healthy enough, that means if you have 2 brokers and you send plenty messages to them and are messages all successfully sent, howerver, one broker is slow so the latency is high. For this high latency broker, we should update it to fault item and isolate it for a while, in case the bad broker goes worse, then the client will enjoy a good sending experience.
But the sendLatencyFaultEnable is set to false by default, which you can enable by calling setSendLatencyFaultEnable(true)