You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/10/09 12:26:15 UTC
[I] [Bug] ProducerWithNamespace example prints "send success" for non-SEND_OK statuses [rocketmq]
chennaji9 opened a new issue, #11329:
URL: https://github.com/apache/rocketmq/issues/11329
### Description
The namespace example `example/src/main/java/org/apache/rocketmq/example/namespace/ProducerWithNamespace.java` reports every completed send as a success:
```java
SendResult result = producer.send(message);
System.out.printf("Topic:%s send success, misId is:%s%n", message.getTopic(), result.getMsgId());
```
`DefaultMQProducer.send` can return normally with a non-`SEND_OK` status — `FLUSH_DISK_TIMEOUT`, `FLUSH_SLAVE_TIMEOUT`, `SLAVE_NOT_AVAILABLE` — exactly the cases where persistence or replication did not meet the requested guarantee. The example then prints "send success", hiding the degraded status from whoever is learning from the sample. (The example also misspells `msgId` as `misId`.)
### Expected behavior
The output should carry the actual `SendResult` status (e.g. print `result.getSendStatus()`), so a non-`SEND_OK` result is visible instead of being labeled "success".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] ProducerWithNamespace example prints "send success" for non-SEND_OK statuses [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #11329:
URL: https://github.com/apache/rocketmq/issues/11329#issuecomment-6095958812
**Issue Evaluation**
Category: `type/bug` | Status: **Confirmed**
`ProducerWithNamespace` example prints "send success" for all send results, including non-`SEND_OK` statuses. The example should check the actual `SendResult` status before logging success.
**Impact:** Example code accuracy
**Severity:** Low
---
*Automated evaluation by RockteMQ-AI*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] ProducerWithNamespace example prints "send success" for non-SEND_OK statuses [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #11329:
URL: https://github.com/apache/rocketmq/issues/11329#issuecomment-6110376203
**Issue Evaluation**
Category: `type/bug` (example) | Status: **Confirmed**
`ProducerWithNamespace.java` prints "send success" for every completed send without checking `SendResult.getSendStatus()`. `DefaultMQProducer.send()` can return normally with non-`SEND_OK` statuses (`FLUSH_DISK_TIMEOUT`, `FLUSH_SLAVE_TIMEOUT`, `SLAVE_NOT_AVAILABLE`) — exactly the cases where persistence guarantees are not met and the caller should know.
**Suggested fix:** Check `result.getSendStatus() == SendStatus.SEND_OK` before printing success; report the actual status otherwise.
---
*Automated evaluation by RocketMQ-AI*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org