From 0548593b30466e527f0591e757e6efa204ab793d Mon Sep 17 00:00:00 2001 From: hqbfz <125714719+3424672656@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:23:47 +0800 Subject: [PATCH] [ISSUE #8998] No retry is required when the remaining time reaches zero (#8999) --- .../java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java index c462dd1241c..7d4b51cfc5f 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java @@ -776,7 +776,7 @@ private void onExceptionImpl(final String brokerName, final DefaultMQProducerImpl producer ) { int tmp = curTimes.incrementAndGet(); - if (needRetry && tmp <= timesTotal) { + if (needRetry && tmp <= timesTotal && timeoutMillis > 0) { String retryBrokerName = brokerName;//by default, it will send to the same broker if (topicPublishInfo != null) { //select one message queue accordingly, in order to determine which broker to send MessageQueue mqChosen = producer.selectOneMessageQueue(topicPublishInfo, brokerName, false);