RockteMQ-AI commented on issue #780:
URL: 
https://github.com/apache/rocketmq-spring/issues/780#issuecomment-5524744240

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase.
   
   **Root Cause:** In `RocketMQClientTemplate.receiveAsync()` (line 373–377), 
`simpleConsumer.close()` is called immediately after 
`simpleConsumer.receiveAsync(...)`, closing the shared singleton 
`SimpleConsumer`. This:
   1. Disrupts the in-flight async receive operation that was just started
   2. Permanently breaks the template — all subsequent 
`receive`/`receiveAsync`/`ack`/`changeInvisibleDuration` calls fail because the 
consumer is already closed
   
   The synchronous sibling `receive()` (line 367–370) does **not** close the 
consumer, confirming this is an erroneous addition.
   
   **Impact:** Critical — calling `receiveAsync()` once renders the entire 
template unusable. The `SimpleConsumer` lifecycle should be managed by the 
Spring bean's `destroy()` method, not by individual operations.
   
   **Severity:** High — single call breaks all subsequent consumer operations 
on the template.
   
   **Suggested Fix:** Remove the `simpleConsumer.close()` call from 
`receiveAsync()`. The consumer lifecycle is already properly managed by the 
Spring bean destroy callback.
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to