chennaji9 opened a new issue, #11323:
URL: https://github.com/apache/rocketmq/issues/11323
### Description
The request-reply example
`example/src/main/java/org/apache/rocketmq/example/rpc/ResponseConsumer.java`
acknowledges every request as successfully consumed even when sending the reply
failed:
```java
try {
...
SendResult replyResult = replyProducer.send(replyMessage, 3000);
System.out.printf("reply to %s , %s %n", replyTo,
replyResult.toString());
} catch (MQClientException | RemotingException | MQBrokerException |
InterruptedException e) {
e.printStackTrace();
}
...
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
```
When the reply send throws (broker briefly unavailable, network hiccup), the
exception is only printed and the listener still returns `CONSUME_SUCCESS`. The
request message is removed from the queue, the requester never receives a
reply, and its `request()` call eventually times out — even though a redelivery
would very likely have produced the reply. `InterruptedException` additionally
swallows the interrupt status.
The same flawed snippet is embedded in `docs/cn/rpc_request.md` (lines
~84-88).
### Expected behavior
On a failed reply send the example should return `RECONSUME_LATER` so the
request is redelivered and the reply retried (matching the error handling of
the simple consumer examples); on `InterruptedException` it should restore the
interrupt flag before returning. The doc copy should be updated to match.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]