{"record":{"id":"682e795d8162810d","repo":"paascloud/paascloud-master","slug":"tpc100500014","errorCode":"TPC100500014","errorMessage":"TPC100500014","messagePattern":"TPC100500014","errorType":"error_code","errorClass":"TpcBizException","httpStatus":null,"severity":"critical","filePath":"paascloud-provider/paascloud-provider-tpc/src/main/java/com/paascloud/provider/mq/RocketMqProducer.java","lineNumber":59,"sourceCode":"\t\tMessage message = MqMessage.checkMessage(body, topic, tag, key);\n\t\tif (delayLevel < 0 || delayLevel > GlobalConstant.Number.EIGHTEEN_INT) {\n\t\t\tthrow new TpcBizException(ErrorCodeEnum.TPC100500013, topic, key);\n\t\t}\n\t\tmessage.setDelayTimeLevel(delayLevel);\n\t\treturn retrySendMessage(pid, message);\n\t}\n\n\tprivate static SendResult retrySendMessage(String pid, Message msg) {\n\t\tint iniCount = 1;\n\t\tSendResult result;\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tresult = MqProducerBeanFactory.getBean(pid).send(msg);\n\t\t\t\tbreak;\n\t\t\t} catch (Exception e) {\n\t\t\t\tlog.error(\"发送消息失败:\", e);\n\t\t\t\tif (iniCount++ >= PRODUCER_RETRY_TIMES) {\n\t\t\t\t\tthrow new TpcBizException(ErrorCodeEnum.TPC100500014, msg.getTopic(), msg.getKeys());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlog.info(\"<== 发送MQ SendResult={}\", result);\n\t\treturn result;\n\t}\n\n}\n","sourceCodeStart":41,"sourceCodeEnd":68,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-tpc/src/main/java/com/paascloud/provider/mq/RocketMqProducer.java#L41-L68","documentation":"TPC100500014 (\"MQ重试三次,仍然发送失败, Topic=%s, MessageKey=%s\") is thrown by RocketMqProducer.retrySendMessage when sending the message fails on every attempt up to PRODUCER_RETRY_TIMES (3). Each underlying exception is logged, and once retries are exhausted the TpcBizException is raised with the topic and message key. The message was not delivered to the broker.","triggerScenarios":"Calling sendSimpleMessage when the RocketMQ producer bean (looked up by pid) repeatedly fails to send: broker down, nameserver unreachable, topic does not exist, producer not started, or message rejected by the broker.","commonSituations":"RocketMQ cluster outage or network partition; topic deleted or autoCreateTopicEnable=false; wrong producer group (pid) configured; broker disk-full causing send rejections; credentials/ACL failures after a broker upgrade.","solutions":["Check the '发送消息失败' log entries for the root exception on each of the 3 attempts (broker address, error code).","Verify the RocketMQ nameserver/broker are reachable and the topic exists (autoCreateTopic or create it manually).","Confirm the producer group id (pid) is configured and its producer bean started successfully in MqProducerBeanFactory.","Re-send the message after fixing connectivity; RocketMQ send is idempotent per key, so retry with the same key is safe.","Implement a local outbox/persistent queue for critical messages so failures can be replayed later."],"exampleFix":"// before: fire and forget, message lost on failure\nRocketMqProducer.sendSimpleMessage(body, topic, tag, key, pid, 0);\n// after: capture failure and persist for replay\ntry {\n    RocketMqProducer.sendSimpleMessage(body, topic, tag, key, pid, 0);\n} catch (TpcBizException e) {\n    outboxRepository.save(new OutboxMessage(topic, tag, key, body)); // replay later\n}","handlingStrategy":"retry","validationCode":"if (!producerHealthy(pid)) { // producer bean started and broker reachable\n    throw new IllegalStateException(\"MQ producer not ready: \" + pid);\n}\nif (!brokerTopicExists(topic)) { throw new IllegalStateException(\"topic missing: \" + topic); }","typeGuard":null,"tryCatchPattern":"try {\n    RocketMqProducer.sendSimpleMessage(body, topic, tag, key, pid, delayLevel);\n} catch (TpcBizException e) {\n    if (e.getCode() == 10050014) {\n        log.error(\"MQ send exhausted retries topic={} key={}\", topic, key, e);\n        outbox.save(topic, tag, key, body); // persist for replay\n    } else { throw e; }\n}","preventionTips":["Persist outbound messages in an outbox table and replay on failure.","Monitor broker/nameserver health and topic existence.","Keep the same message key on retries for idempotency.","Alert on any TPC100500014 occurrence — it means data delivery already failed.","Verify producer group config (pid) after deployments."],"tags":["rocketmq","retry","network"],"backgroundTag":"http-request-failed","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}