You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/12/27 09:24:58 UTC

[GitHub] [rocketmq] duhenglucky commented on a change in pull request #3555: [Issue #3556] Fix:When broker is down, rocketmq client can not retry under Async send model

duhenglucky commented on a change in pull request #3555:
URL: https://github.com/apache/rocketmq/pull/3555#discussion_r775412260



##########
File path: client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
##########
@@ -582,7 +582,7 @@ private SendResult sendDefaultImpl(
             MessageQueue mq = null;
             Exception exception = null;
             SendResult sendResult = null;
-            int timesTotal = communicationMode == CommunicationMode.SYNC ? 1 + this.defaultMQProducer.getRetryTimesWhenSendFailed() : 1;
+            int timesTotal = communicationMode == CommunicationMode.SYNC ? 1 + this.defaultMQProducer.getRetryTimesWhenSendFailed() : 1 + this.defaultMQProducer.getRetryTimesWhenSendAsyncFailed();

Review comment:
       This is indeed an issue that when there is a problem with the broker network, there will be no retry after the asynchronous sending fails, howerver, this change seems to result in too many retries, because the async retry logic is in the kernel method: _org.apache.rocketmq.client.impl.MQClientAPIImpl#sendMessageAsync_, so how about adding a try... catch arround the  _this.remotingClient.invokeAsync_ with an _onExceptionImpl_ exception resolve logic?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org