{"record":{"id":"0c3ed3a3f2f5bbc6","repo":"apache/rocketmq","slug":"the-broker-service-address-not-found","errorCode":null,"errorMessage":"The broker service address not found","messagePattern":"The broker service address not found","errorType":"exception","errorClass":"MQClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java","lineNumber":1593,"sourceCode":"        if (NamespaceUtil.isRetryTopic(topic) || NamespaceUtil.isDLQTopic(topic)) {\n            throw new MQClientException(\"topic is not supported\", null);\n        }\n        RecallMessageHandle.HandleV1 handleEntity;\n        try {\n            handleEntity = (RecallMessageHandle.HandleV1) RecallMessageHandle.decodeHandle(recallHandle);\n        } catch (Exception e) {\n            throw new MQClientException(e.getMessage(), null);\n        }\n\n        tryToFindTopicPublishInfo(topic);\n        String brokerAddr = this.mQClientFactory.findBrokerAddressInPublish(handleEntity.getBrokerName());\n        brokerAddr = StringUtils.isNotEmpty(brokerAddr) ?\n            // find another address to support multi proxy endpoints,\n            // may cause failure request in proxy-less mode when the broker is temporarily unavailable\n            brokerAddr : this.mQClientFactory.findBrokerAddrByTopic(topic);\n        if (StringUtils.isEmpty(brokerAddr)) {\n            log.warn(\"can't find broker service address. {}\", handleEntity.getBrokerName());\n            throw new MQClientException(\"The broker service address not found\", null);\n        }\n        RecallMessageRequestHeader requestHeader = new RecallMessageRequestHeader();\n        requestHeader.setProducerGroup(this.defaultMQProducer.getProducerGroup());\n        requestHeader.setTopic(topic);\n        requestHeader.setRecallHandle(recallHandle);\n        requestHeader.setBrokerName(handleEntity.getBrokerName());\n        return this.mQClientFactory.getMQClientAPIImpl().recallMessage(brokerAddr,\n            requestHeader, this.defaultMQProducer.getSendMsgTimeout());\n    }\n\n    public void setCallbackExecutor(final ExecutorService callbackExecutor) {\n        this.mQClientFactory.getMQClientAPIImpl().getRemotingClient().setCallbackExecutor(callbackExecutor);\n    }\n\n    public ExecutorService getAsyncSenderExecutor() {\n        return null == asyncSenderExecutor ? defaultAsyncSenderExecutor : asyncSenderExecutor;\n    }\n","sourceCodeStart":1575,"sourceCodeEnd":1611,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java#L1575-L1611","documentation":"Thrown by recallMessage when no broker address can be resolved: findBrokerAddressInPublish for the broker named in the decoded handle returned empty, and the fallback findBrokerAddrByTopic(topic) also returned empty (with a preceding 'can't find broker service address' warn log). The client therefore has no endpoint to send the RecallMessageRequestHeader to. The code comments note the fallback exists to support multi-proxy endpoints.","triggerScenarios":"Calling recallMessage when the broker named in the handle is not currently registered in the client's route table (broker down/restarted, route refresh pending), or when the topic's route has no master broker available for publishing.","commonSituations":"Broker outage at recall time; recalling long after the original send so the handle's brokerName no longer exists (renamed/decommissioned broker); client route cache stale right after startup; proxy deployments where the topic route lacks the specific broker from the handle.","solutions":["Wait for route refresh (~30s) or force it via producer.fetchPublishMessageQueues(topic), then retry the recall.","Confirm the broker named in the handle (decode it or check the warn log's broker name) is registered and has a writable master: check mqadmin brokerStatus / broker list on the nameserver.","If the broker was decommissioned, the handle is unusable — re-issue recall from an environment where that broker exists.","In proxy mode, verify the proxy endpoints are configured so findBrokerAddrByTopic can supply an alternative address."],"exampleFix":"// before\nString msgId = producer.recallMessage(topic, handle); // may throw immediately after start\n\n// after\nproducer.fetchPublishMessageQueues(topic); // force route refresh\ntry {\n    String msgId = producer.recallMessage(topic, handle);\n} catch (MQClientException e) {\n    if (e.getMessage().contains(\"broker service address not found\")) {\n        scheduler.schedule(() -> retryRecall(topic, handle), Duration.ofSeconds(30)); // retry after route refresh\n    } else throw e;\n}","handlingStrategy":"retry","validationCode":"// force the client's route table to refresh before recalling\nif (producer.fetchPublishMessageQueues(topic).isEmpty()) {\n    throw new IllegalStateException(\"no route for \" + topic + \"; broker address unresolvable\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    producer.recallMessage(topic, handle);\n} catch (MQClientException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"broker service address not found\")) {\n        producer.fetchPublishMessageQueues(topic);      // trigger route refresh\n        scheduler.schedule(() -> recallQuietly(topic, handle), Duration.ofSeconds(30));\n    } else throw e;\n}","preventionTips":["Warm route caches before attempting recall operations.","Recall soon after obtaining the handle; stale handles reference broker names that may vanish.","In proxy deployments, configure all proxy endpoints so the fallback address lookup can succeed."],"tags":["rocketmq","producer","message-recall","no-route","broker-unavailable"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}