wang-jiahua opened a new pull request, #781:
URL: https://github.com/apache/rocketmq-spring/pull/781
### Which Issue(s) This PR Fixes
Fixes #780
### Brief Description
`receiveAsync` closed the shared `SimpleConsumer` singleton right after
starting an async receive, which disrupted the in-flight future and permanently
broke every subsequent `receive`/`receiveAsync`/`ack`/`changeInvisibleDuration`
on the same template ("consumer already closed"). The consumer's lifecycle
belongs to the bean's `destroy()`, which already closes it — the synchronous
`receive()` sibling never closes it either.
Fix: remove the `simpleConsumer.close()` call from `receiveAsync`.
### How Did You Test This Change?
New regression test `RocketMQClientTemplateReceiveAsyncTest` using a
recording fake consumer (the module has no mockito): on the unfixed code it
fails with `expected:<0> but was:<1>` (close was invoked); with the fix it
passes — close count stays 0, the consumer remains usable, and a second
`receiveAsync` succeeds. 1/1 pass on current master.
--
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]