rocketmq-client-cpp
rocketmq-client-cpp copied to clipboard
bug, should rethrow error
https://github.com/apache/rocketmq-client-cpp/blob/a42de735a3319a859f6108c9e714ed715fe45969/src/consumer/DefaultMQPullConsumerImpl.cpp#L290
It looks like the code has some issue, and I think call callback function is better.
User should catch this exception and may call the PullCallback::onException(MQException &), and then delete call back if it was allocated in heap when PullCallback::onException(MQException &) don't "delete this", just like the code in send message( another issue in send user should konw is the AutoDeleteSendCallback don't work normally in this case because it is called by SendCallbackWrap::onException ). It's my opinion.
https://github.com/apache/rocketmq-client-cpp/blob/a42de735a3319a859f6108c9e714ed715fe45969/src/producer/DefaultMQProducerImpl.cpp#L248
I mean all PulCalllbacks which were allocated in heap need to "delete this" in onSuccess or onException because there is no AutoDeletePullCallback to be inherited by user. SendCallback does has AutoDeleteSendCallback, but if there is exception occurs in send AutoDeleteSendCallback don't work, so user should catch exceptions and delete SendCallback mannually. I am confused why PullCallback doesn't has AutoDelete like SendCallback:
https://github.com/apache/rocketmq-client-cpp/blob/87350727950d1ece9ed3ffab414bbe0f673eeaac/include/AsyncCallback.h#L39
@ShannonDing ping
Maybe I make a pr when I'm free?
@shuyanzhu Welcome to PR.
@shuyanzhu I check this issue again, and I think the version of re_dev branch meets your expectations.
Looks like there is no pull API anymore, nice(Doge)
Should I close this issue?
Looks like there is no pull API anymore, nice(Doge)
A new LitePullConsumer is wip.
Should I close this issue?
Improving the master branch is also beneficial, welcome to PR.