charlely commented on code in PR #6612:
URL: https://github.com/apache/inlong/pull/6612#discussion_r1031005831


##########
inlong-tubemq/tubemq-client-twins/tubemq-client-cpp/src/tubemq_client.cc:
##########
@@ -174,5 +175,99 @@ bool TubeMQConsumer::GetCurConsumedInfo(map<string, 
ConsumeOffsetInfo>& consume_
   return rmt_client->GetCurConsumedInfo(consume_info_map);
 }
 
-}  // namespace tubemq
+TubeMQProducer::TubeMQProducer() {
+  client_id_ = tb_config::kInvalidValue;
+  status_.Set(0);
+}
+
+TubeMQProducer::~TubeMQProducer() {
+  ShutDown();
+}
+
+bool TubeMQProducer::Start(string& err_info, const ProducerConfig& config) {
+  if (!TubeMQService::Instance()->IsRunning()) {
+    err_info = "TubeMQ Service not started!";
+    return false;
+  }
+
+  if (!status_.CompareAndSet(0, 1)) {

Review Comment:
   Status if you can use const to define is Good, Magic Number...



-- 
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