
同步重试,异步或者oneway不再重发消息

例如:如果发送时间是3000毫秒,则mq预计broker的不可用时长为18000L(根据latencyMax数组,notAvailableDuration数组对应关系得到),则broker恢复正常时间为:当前时间+不可用时长,即System.currentTimeMillis() + notAvailableDuration 。

循环一直找到一个可用的broker。虽然broker有定时剔除,但Broker故障转移机制,可以选择更有效的broker。
网友评论