RocketMQ高手之路系列之六:RocketMQ之消息发送(三)

文章详细讨论了Broker的故障延迟策略,特别是MQFaultStrategy中的selectOneMessageQueue方法,它在处理Broker故障时如何选择消息队列。同时提及了Java工程师的学习资源,如《2024年Java开发全套学习资料》及其内容结构。
摘要由CSDN通过智能技术生成

}

// Update sub info

{

Set subscribeInfo = topicRouteData2TopicSubscribeInfo(topic, topicRouteData);

Iterator<Entry<String, MQConsumerInner>> it = this.consumerTable.entrySet().iterator();

while (it.hasNext()) {

Entry<String, MQConsumerInner> entry = it.next();

MQConsumerInner impl = entry.getValue();

if (impl != null) {

impl.updateTopicSubscribeInfo(topic, subscribeInfo);

}

}

}

log.info(“topicRouteTable.put. Topic = {}, TopicRouteData[{}]”, topic, cloneTopicRouteData);

this.topicRouteTable.put(topic, cloneTopicRouteData);

return true;

}

} else {

log.warn(“updateTopicRouteInfoFromNameServer, getTopicRouteInfoFromNameServer return null, Topic: {}”, topic);

}

} catch (Exception e) {

if (!topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) && !topic.equals(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC)) {

log.warn(“updateTopicRouteInfoFromNameServer Exception”, e);

}

} finally {

this.lockNamesrv.unlock();

}

} else {

log.warn(“updateTopicRouteInfoFromNameServer tryLock timeout {}ms”, LOCK_TIMEOUT_MILLIS);

}

} catch (InterruptedException e) {

log.warn(“updateTopicRouteInfoFromNameServer Exception”, e);

}

return false;

}

public MessageQueue selectOneMessageQueue(final String lastBrokerName) {

if (lastBrokerName

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值