{"record":{"id":"6f1cb6d1cce0f106","repo":"alibaba/spring-ai-alibaba","slug":"failed-to-send-message","errorCode":null,"errorMessage":"Failed to send message","messagePattern":"Failed to send message","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/mq/MqProducerManager.java","lineNumber":66,"sourceCode":"\tprivate static final ClientServiceProvider provider = ClientServiceProvider.loadService();\n\n\t/** MQ configuration properties */\n\tprivate final MqConfigProperties mqConfigProperties;\n\n\t/**\n\t * Sends a message synchronously\n\t * @param producer MQ producer instance\n\t * @param message Message to be sent\n\t * @return Send result containing message ID\n\t */\n\tpublic SendResult send(Producer producer, MqMessage message) {\n\t\ttry {\n\t\t\tSendReceipt sendReceipt = producer.send(buildMessage(message));\n\t\t\treturn SendResult.builder().messageId(sendReceipt.getMessageId().toString()).build();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlog.error(\"Failed to send message, topic: {}\", message.getTopic(), e);\n\t\t\tthrow new RuntimeException(\"Failed to send message\", e);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a delayed message synchronously\n\t * @param producer MQ producer instance\n\t * @param message Message to be sent\n\t * @param delaySeconds Delay time in seconds\n\t * @return Send result containing message ID\n\t */\n\tpublic SendResult sendDelay(Producer producer, MqMessage message, int delaySeconds) {\n\t\ttry {\n\t\t\t// 计算延迟时间戳\n\t\t\tlong deliveryTimestamp = System.currentTimeMillis() + (delaySeconds * 1000L);\n\t\t\tmessage.setDeliveryTimestamp(deliveryTimestamp);\n\n\t\t\tSendReceipt sendReceipt = producer.send(buildMessage(message));\n\t\t\treturn SendResult.builder().messageId(sendReceipt.getMessageId().toString()).build();","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/mq/MqProducerManager.java#L48-L84","documentation":"MqProducerManager.send wraps any exception from the RocketMQ producer.send() synchronous call (network errors, broker unavailable, topic not found, message property violations). The message was not delivered to the broker.","triggerScenarios":"Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/mq/MqProducerManager.java:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check MQ endpoint, credentials, and topic configuration in MqConfigProperties","Retry the send with backoff; synchronous sends are retry-safe if idempotency is handled","Log and persist failed messages to an outbox for later re-delivery","Verify broker connectivity and message size/property limits"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}