fix communicationMode
cause sync as try once , and async can try once more, but this line code is not that meaning, and from the invoke context alse can explain there has some logic wrong.

so change the code:
int timesTotal = communicationMode == CommunicationMode.SYNC ? 1 + this.defaultMQProducer.getRetryTimesWhenSendFailed() : 1;
fix as:
int timesTotal = communicationMode == CommunicationMode.ASYNC ? 1 + this.defaultMQProducer.getRetryTimesWhenSendFailed() : 1;
here is the fixed file: DefaultMQProducerImpl.java
@liony It seems that you want to retry in async mode, actually, async send message wouldn't block the request process and users need to do more in the callback, and sync mode need give users a deterministic return result.
@duhenglucky : maybe I drop into a pit intellectually: I want to express that we could not consider whether is sync or not, if user has set retryTimesWhenSendFaied variable a value, then we should help one to retry before the timeout. based on that thinking about above, so I give the suggection for repairing maybe like this:
boolean retryFlag = this.defaultMQProducer.getRetryTimesWhenSendFailed() > 0;
int timesTotal = retryFlag ? this.defaultMQProducer.getRetryTimesWhenSendFailed() : 1;
did you see retryTimesWhenSendAsyncFailed properties @liony
@liony as @CodeIngL said if you just want to increase the retry times in async mode, please set retryTimesWhenSendAsyncFailed directly, and more detail can be found in org.apache.rocketmq.client.impl.MQClientAPIImpl#sendMessageAsync, so I will close this issue first, but if you have other questions, please feel free to reopen it.