This is an automated email from the ASF dual-hosted git repository.
lizhimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
The following commit(s) were added to refs/heads/master by this push:
new f117e73d [ISSUE #935] C++ simple consumer should remove destructor
(#938)
f117e73d is described below
commit f117e73d5adde7ddf71359396f4d2e5e4a11d9ed
Author: lizhimins <[email protected]>
AuthorDate: Tue Feb 11 14:08:40 2025 +0800
[ISSUE #935] C++ simple consumer should remove destructor (#938)
---
cpp/examples/ExampleSimpleConsumer.cpp | 1 +
cpp/include/rocketmq/SimpleConsumer.h | 2 --
cpp/source/rocketmq/SimpleConsumer.cpp | 4 ----
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/cpp/examples/ExampleSimpleConsumer.cpp
b/cpp/examples/ExampleSimpleConsumer.cpp
index c28d2e4d..2d93d239 100644
--- a/cpp/examples/ExampleSimpleConsumer.cpp
+++ b/cpp/examples/ExampleSimpleConsumer.cpp
@@ -59,6 +59,7 @@ int main(int argc, char* argv[]) {
.withAwaitDuration(std::chrono::seconds(10))
.build();
+ // Should use while (true) instead
for (int j = 0; j < 30; j++) {
std::vector<MessageConstSharedPtr> messages;
std::error_code ec;
diff --git a/cpp/include/rocketmq/SimpleConsumer.h
b/cpp/include/rocketmq/SimpleConsumer.h
index 0550f73a..cb489c91 100644
--- a/cpp/include/rocketmq/SimpleConsumer.h
+++ b/cpp/include/rocketmq/SimpleConsumer.h
@@ -43,8 +43,6 @@ class SimpleConsumerBuilder;
class SimpleConsumer {
public:
- ~SimpleConsumer();
-
static SimpleConsumerBuilder newBuilder();
void subscribe(std::string topic, FilterExpression filter_expression);
diff --git a/cpp/source/rocketmq/SimpleConsumer.cpp
b/cpp/source/rocketmq/SimpleConsumer.cpp
index 5ab92f4b..2b5e79b0 100644
--- a/cpp/source/rocketmq/SimpleConsumer.cpp
+++ b/cpp/source/rocketmq/SimpleConsumer.cpp
@@ -33,10 +33,6 @@ SimpleConsumerBuilder SimpleConsumer::newBuilder() {
SimpleConsumer::SimpleConsumer(std::string group) :
impl_(std::make_shared<SimpleConsumerImpl>(group)) {
}
-SimpleConsumer::~SimpleConsumer() {
- impl_->shutdown();
-}
-
void SimpleConsumer::start() {
impl_->start();
}