聊聊rocketmq的retryTimesWhenSendFailed
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了聊聊rocketmq的retryTimesWhenSendFailed相关的知识,希望对你有一定的参考价值。
参考技术A 本文主要研究一下rocketmq的retryTimesWhenSendFailedrocketmq-client-4.5.2-sources.jar!/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
rocketmq-client-4.5.2-sources.jar!/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
rocketmq-client-4.5.2-sources.jar!/org/apache/rocketmq/client/impl/MQClientAPIImpl.java
DefaultMQProducerImpl的sendDefaultImpl方法通过tryToFindTopicPublishInfo找到topicPublishInfo,如果不为null且是ok的,则根据communicationMode计算timesTotal,其中是CommunicationMode.SYNC的话,timesTotal为1 + defaultMQProducer.getRetryTimesWhenSendFailed(),否则为1;之后就是最多循环timesTotal次执行sendKernelImpl,RemotingException异常及MQBrokerException异常中responseCode为TOPIC_NOT_EXIST、SERVICE_NOT_AVAILABLE、SYSTEM_ERROR、NO_PERMISSION、NO_BUYER_ID、NOT_IN_CURRENT_UNIT或者是sendResult.getSendStatus()不等于SendStatus.SEND_OK的会重试
聊聊rocketmq的RemotingTooMuchRequestException
参考技术A 本文主要研究一下rocketmq的RemotingTooMuchRequestExceptionrocketmq-remoting-4.6.0-sources.jar!/org/apache/rocketmq/remoting/exception/RemotingTooMuchRequestException.java
rocketmq-client-4.6.0-sources.jar!/org/apache/rocketmq/client/impl/MQClientAPIImpl.java
rocketmq-client-4.6.0-sources.jar!/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
rocketmq-client-4.6.0-sources.jar!/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
rocketmq-client-4.6.0-sources.jar!/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
以上是关于聊聊rocketmq的retryTimesWhenSendFailed的主要内容,如果未能解决你的问题,请参考以下文章
聊聊rocketmq的RemotingTooMuchRequestException
聊聊rocketmq的retryTimesWhenSendFailed