You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by if...@apache.org on 2020/12/29 03:36:29 UTC

[rocketmq-client-cpp] 12/29: style: follow Chromium c++ style

This is an automated email from the ASF dual-hosted git repository.

ifplusor pushed a commit to branch re_dev
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git

commit 6bf16392daeba44cca1ed37536f0ab1505bf1d3e
Author: James Yin <yw...@hotmail.com>
AuthorDate: Wed Jul 22 00:52:29 2020 +0800

    style: follow Chromium c++ style
---
 example/ArgHelper.cpp                              |  20 +-
 example/ArgHelper.h                                |   9 +-
 example/AsyncProducer.cpp                          |   6 +-
 example/BatchProducer.cpp                          |   6 +-
 example/OrderlyProducer.cpp                        |   6 +-
 example/OrderlyPushConsumer.cpp                    |   2 +-
 example/PullConsumer.cpp                           |   6 +-
 example/PushConsumer.cpp                           |   2 +-
 example/RequestReply.cpp                           |   4 +-
 example/SyncProducer.cpp                           |   6 +-
 example/TransactionProducer.cpp                    |   8 +-
 example/common.h                                   |  14 +-
 include/AllocateMQStrategy.h                       |   2 +-
 include/Array.h                                    |   2 +-
 include/ConsumeType.h                              |   6 +-
 include/DefaultMQProducer.h                        |  10 +-
 include/DefaultMQProducerConfig.h                  |  16 +-
 include/DefaultMQProducerConfigProxy.h             |  90 ++--
 include/DefaultMQPullConsumer.h                    |   6 +-
 include/DefaultMQPullConsumerConfig.h              |   6 +-
 include/DefaultMQPullConsumerConfigProxy.h         |   6 +-
 include/DefaultMQPushConsumer.h                    |  10 +-
 include/DefaultMQPushConsumerConfig.h              |  16 +-
 include/DefaultMQPushConsumerConfigProxy.h         | 102 ++--
 include/MQAdmin.h                                  |   6 +-
 include/MQClientConfig.h                           |  12 +-
 include/MQClientConfigProxy.h                      |  66 ++-
 include/MQConsumer.h                               |  11 +-
 include/{MQClientException.h => MQException.h}     |  57 +-
 include/MQMessage.h                                |   2 +-
 include/MQMessageConst.h                           |   6 +-
 include/MQMessageExt.h                             |   2 +-
 include/MQMessageListener.h                        |  17 +-
 include/MQMessageQueue.h                           |  12 +-
 include/MQProducer.h                               |   8 +-
 include/MQPullConsumer.h                           |   6 +-
 include/MQPushConsumer.h                           |  12 +-
 include/MQSelector.h                               |   8 +-
 include/Message.h                                  |   2 +-
 include/MessageExt.h                               |   2 +-
 include/MessageUtil.h                              |   5 +-
 include/{AllocateMQStrategy.h => OffsetStore.h}    |  33 +-
 include/PullCallback.h                             |  16 +-
 include/QueryResult.h                              |   6 +-
 include/RemotingCommand.h                          |   5 +-
 include/RequestCallback.h                          |  20 +-
 include/SendCallback.h                             |  20 +-
 include/SendResult.h                               |  68 ++-
 include/SessionCredentials.h                       |  56 +-
 include/TransactionListener.h                      |   9 +-
 include/TransactionMQProducer.h                    |  25 +-
 include/TransactionMQProducerConfig.h              |   9 +-
 include/TransactionSendResult.h                    |  16 +-
 include/c/CBatchMessage.h                          |   6 +-
 include/c/CCommon.h                                |   6 +-
 include/c/CErrorMessage.h                          |   6 +-
 include/c/CMQException.h                           |   6 +-
 include/c/CMessage.h                               |   8 +-
 include/c/CMessageExt.h                            |   8 +-
 include/c/CMessageQueue.h                          |   6 +-
 include/c/CProducer.h                              |   9 +-
 include/c/CPullConsumer.h                          |   6 +-
 include/c/CPullResult.h                            |   6 +-
 include/c/CPushConsumer.h                          |   8 +-
 include/c/CSendResult.h                            |   6 +-
 include/c/CTransactionStatus.h                     |   6 +-
 src/ClientRemotingProcessor.cpp                    |  12 +-
 src/ClientRemotingProcessor.h                      |   8 +-
 src/MQAdminImpl.cpp                                |  40 +-
 src/MQAdminImpl.h                                  |  10 +-
 src/MQClientAPIImpl.cpp                            |  89 ++--
 src/MQClientAPIImpl.h                              |  18 +-
 src/MQClientConfigImpl.cpp                         | 116 -----
 src/MQClientConfigImpl.h                           |  70 ---
 src/MQClientConfigImpl.hpp                         | 106 ++++
 src/MQClientImpl.cpp                               |  36 +-
 src/MQClientImpl.h                                 |  20 +-
 src/MQClientInstance.cpp                           | 363 +++++++------
 src/MQClientInstance.h                             |  64 +--
 src/MQClientManager.cpp                            |  16 +-
 src/MQClientManager.h                              |  15 +-
 src/common/ClientErrorCode.h                       |   6 +-
 src/common/ClientRPCHook.cpp                       |  24 +-
 src/common/{FilterAPI.h => FilterAPI.hpp}          |  20 +-
 src/common/InvokeCallback.h                        |   7 +-
 src/common/MQVersion.cpp                           |   4 +-
 src/common/MQVersion.h                             |  10 +-
 src/common/MessageSysFlag.h                        |   6 +-
 src/common/NameSpaceUtil.h                         |   6 +-
 src/common/NamesrvConfig.h                         |  50 --
 src/common/PermName.h                              |   9 +-
 src/common/PullCallbackWrap.cpp                    |  18 +-
 src/common/PullCallbackWrap.h                      |  10 +-
 src/common/PullSysFlag.cpp                         |  10 +-
 src/common/PullSysFlag.h                           |  12 +-
 src/common/SendCallbackWrap.cpp                    | 103 ++--
 src/common/SendCallbackWrap.h                      |  40 +-
 src/common/ServiceState.h                          |   6 +-
 src/common/ServiceThread.cpp                       |  36 +-
 src/common/ServiceThread.h                         |  25 +-
 src/common/SubscriptionData.h                      |  53 +-
 src/common/SubscriptionGroupConfig.h               |   8 +-
 src/common/TopicConfig.cpp                         |  93 +---
 src/common/TopicConfig.h                           |  50 +-
 src/common/UtilAll.cpp                             |   2 +-
 src/common/Validators.cpp                          |  17 +-
 src/common/Validators.h                            |  14 +-
 src/common/VirtualEnvUtil.cpp                      |   4 +-
 src/common/VirtualEnvUtil.h                        |   9 +-
 src/common/noncopyable.h                           |   6 +-
 src/concurrent/concurrent_queue.hpp                |   6 +-
 src/concurrent/executor.hpp                        |   6 +-
 src/concurrent/executor_impl.hpp                   |  28 +-
 src/concurrent/latch.hpp                           |   6 +-
 src/concurrent/thread.hpp                          |   6 +-
 src/concurrent/thread_group.hpp                    |  14 +-
 src/concurrent/time.hpp                            |   6 +-
 ...locateMQAveragely.h => AllocateMQAveragely.hpp} |   8 +-
 src/consumer/ConsumeMessageConcurrentlyService.cpp |  45 +-
 src/consumer/ConsumeMessageOrderlyService.cpp      |  73 +--
 src/consumer/ConsumeMsgService.h                   |  27 +-
 src/consumer/DefaultMQPullConsumerImpl.cpp         |   2 +-
 src/consumer/DefaultMQPushConsumer.cpp             |   7 +-
 src/consumer/DefaultMQPushConsumerConfigImpl.cpp   | 125 -----
 src/consumer/DefaultMQPushConsumerConfigImpl.h     |  81 ---
 src/consumer/DefaultMQPushConsumerConfigImpl.hpp   | 112 ++++
 src/consumer/DefaultMQPushConsumerImpl.cpp         | 572 +++++++++++----------
 src/consumer/DefaultMQPushConsumerImpl.h           |  81 +--
 .../{FindBrokerResult.h => FindBrokerResult.hpp}   |  25 +-
 src/consumer/LocalFileOffsetStore.cpp              | 193 +++++++
 src/consumer/LocalFileOffsetStore.h                |  57 ++
 src/consumer/MQConsumerInner.h                     |   7 +-
 src/consumer/MessageQueueLock.hpp                  |  18 +-
 src/consumer/OffsetStore.cpp                       | 328 ------------
 src/consumer/OffsetStore.h                         | 103 ----
 src/consumer/ProcessQueue.cpp                      | 190 +++----
 src/consumer/ProcessQueue.h                        |  78 +--
 src/consumer/PullAPIWrapper.cpp                    |  46 +-
 src/consumer/PullAPIWrapper.h                      |  18 +-
 src/consumer/PullMessageService.hpp                |  28 +-
 src/consumer/PullRequest.cpp                       |  52 +-
 src/consumer/PullRequest.h                         |  44 +-
 src/consumer/PullResult.cpp                        |   4 +-
 .../{PullResultExt.h => PullResultExt.hpp}         |   6 +-
 src/consumer/RebalanceImpl.cpp                     | 192 +++----
 src/consumer/RebalanceImpl.h                       |  42 +-
 src/consumer/RebalancePullImpl.h                   |   2 +-
 src/consumer/RebalancePushImpl.cpp                 |  53 +-
 src/consumer/RebalancePushImpl.h                   |  10 +-
 src/consumer/RebalanceService.h                    |  12 +-
 src/consumer/RemoteBrokerOffsetStore.cpp           | 153 ++++++
 src/consumer/RemoteBrokerOffsetStore.h             |  54 ++
 src/consumer/SubscriptionData.cpp                  |  70 +--
 ...lientErrorContainer.cpp => CErrorContainer.cpp} |  18 +-
 ...{MQClientErrorContainer.h => CErrorContainer.h} |  18 +-
 src/extern/CErrorMessage.cpp                       |   4 +-
 src/extern/CProducer.cpp                           | 102 ++--
 src/extern/CPullConsumer.cpp                       |  20 +-
 src/extern/CPushConsumer.cpp                       |  54 +-
 src/log/Logging.cpp                                |  95 ++--
 src/log/Logging.h                                  |  79 +--
 src/message/MQMessageExt.cpp                       |  56 +-
 .../{MessageAccessor.h => MessageAccessor.hpp}     |   6 +-
 src/message/MessageBatch.cpp                       |   2 +-
 src/message/MessageBatch.h                         |  12 +-
 src/message/MessageClientIDSetter.cpp              |  16 +-
 src/message/MessageClientIDSetter.h                |  29 +-
 src/message/MessageDecoder.cpp                     |  17 +-
 src/message/MessageDecoder.h                       |  12 +-
 src/message/MessageUtil.cpp                        |   2 +-
 src/producer/CorrelationIdUtil.hpp                 |   6 +-
 src/producer/DefaultMQProducer.cpp                 |  11 +-
 src/producer/DefaultMQProducerConfigImpl.cpp       |  88 ----
 src/producer/DefaultMQProducerConfigImpl.h         |  63 ---
 src/producer/DefaultMQProducerConfigImpl.hpp       |  84 +++
 src/producer/DefaultMQProducerImpl.cpp             | 383 +++++++-------
 src/producer/DefaultMQProducerImpl.h               |  56 +-
 src/producer/LatencyFaultTolerancyImpl.cpp         |  64 ++-
 src/producer/LatencyFaultTolerancyImpl.h           |  52 +-
 src/producer/MQFaultStrategy.cpp                   |   6 +-
 src/producer/MQFaultStrategy.h                     |   8 +-
 src/producer/MQProducerInner.h                     |   6 +-
 src/producer/RequestFutureTable.cpp                |  16 +-
 src/producer/RequestFutureTable.h                  |  10 +-
 src/producer/RequestResponseFuture.cpp             |  70 +--
 src/producer/RequestResponseFuture.h               |  35 +-
 src/producer/SendResult.cpp                        |  69 +--
 src/producer/TopicPublishInfo.h                    | 111 ----
 src/producer/TopicPublishInfo.hpp                  | 111 ++++
 src/producer/TransactionMQProducer.cpp             |  34 +-
 src/producer/TransactionMQProducerConfigImpl.cpp   |  31 --
 ...gImpl.h => TransactionMQProducerConfigImpl.hpp} |  18 +-
 src/protocol/ConsumerRunningInfo.cpp               |  54 +-
 src/protocol/ConsumerRunningInfo.h                 |  57 +-
 src/protocol/MQProtos.h                            |   6 +-
 src/protocol/MessageQueue.cpp                      |   6 +-
 src/protocol/RemotingCommand.cpp                   |  10 +-
 src/protocol/RemotingSerializable.cpp              |   2 +-
 src/protocol/RemotingSerializable.h                |   6 +-
 src/protocol/RequestCode.h                         |   6 +-
 src/protocol/ResponseCode.h                        |   6 +-
 src/protocol/TopicRouteData.h                      | 149 ------
 src/protocol/TopicRouteData.hpp                    | 189 +++++++
 src/protocol/header/CommandHeader.cpp              |   2 +-
 src/protocol/header/CommandHeader.h                |   8 +-
 src/transport/EventLoop.cpp                        | 110 ++--
 src/transport/EventLoop.h                          |  51 +-
 src/transport/RequestProcessor.h                   |   6 +-
 src/transport/ResponseFuture.cpp                   |  82 ++-
 src/transport/ResponseFuture.h                     |  38 +-
 src/transport/SocketUtil.cpp                       |   2 +-
 src/transport/SocketUtil.h                         |   6 +-
 src/transport/TcpRemotingClient.cpp                | 196 +++----
 src/transport/TcpRemotingClient.h                  |  38 +-
 src/transport/TcpTransport.cpp                     |  72 +--
 src/transport/TcpTransport.h                       |  24 +-
 test/src/common/NamesrvConfigTest.cpp              |  47 --
 test/src/common/TopicConfigTest.cpp                |  50 +-
 test/src/common/ValidatorsTest.cpp                 |   8 +-
 test/src/extern/CPullConsumerTest.cpp              |   2 +-
 test/src/message/MQMessageQueueTest.cpp            |  44 +-
 test/src/protocol/CommandHeaderTest.cpp            |   2 +-
 test/src/protocol/MessageQueueTest.cpp             |   6 +-
 test/src/protocol/RemotingCommandTest.cpp          |  20 +-
 test/src/protocol/TopicRouteDataTest.cpp           |  21 +-
 test/src/transport/ClientRemotingProcessorTest.cpp |   2 +-
 test/src/transport/ResponseFutureTest.cpp          |  12 +-
 227 files changed, 4191 insertions(+), 4619 deletions(-)

diff --git a/example/ArgHelper.cpp b/example/ArgHelper.cpp
index 1506233..4958253 100644
--- a/example/ArgHelper.cpp
+++ b/example/ArgHelper.cpp
@@ -22,26 +22,26 @@ namespace rocketmq {
 
 ArgHelper::ArgHelper(int argc, char* argv[]) {
   for (int i = 0; i < argc; i++) {
-    m_args.push_back(argv[i]);
+    args_.push_back(argv[i]);
   }
 }
 
 ArgHelper::ArgHelper(std::string arg_str_) {
   std::vector<std::string> v;
   UtilAll::Split(v, arg_str_, " ");
-  m_args.insert(m_args.end(), v.begin(), v.end());
+  args_.insert(args_.end(), v.begin(), v.end());
 }
 
 std::string ArgHelper::get_option(int idx_) const {
-  if ((size_t)idx_ >= m_args.size()) {
+  if ((size_t)idx_ >= args_.size()) {
     return "";
   }
-  return m_args[idx_];
+  return args_[idx_];
 }
 
 bool ArgHelper::is_enable_option(std::string opt_) const {
-  for (size_t i = 0; i < m_args.size(); ++i) {
-    if (opt_ == m_args[i]) {
+  for (size_t i = 0; i < args_.size(); ++i) {
+    if (opt_ == args_[i]) {
       return true;
     }
   }
@@ -50,13 +50,13 @@ bool ArgHelper::is_enable_option(std::string opt_) const {
 
 std::string ArgHelper::get_option_value(std::string opt_) const {
   std::string ret = "";
-  for (size_t i = 0; i < m_args.size(); ++i) {
-    if (opt_ == m_args[i]) {
+  for (size_t i = 0; i < args_.size(); ++i) {
+    if (opt_ == args_[i]) {
       size_t value_idx = ++i;
-      if (value_idx >= m_args.size()) {
+      if (value_idx >= args_.size()) {
         return ret;
       }
-      ret = m_args[value_idx];
+      ret = args_[value_idx];
       return ret;
     }
   }
diff --git a/example/ArgHelper.h b/example/ArgHelper.h
index bd1e15d..bf391ef 100644
--- a/example/ArgHelper.h
+++ b/example/ArgHelper.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __ARG_HELPER_H__
-#define __ARG_HELPER_H__
+#ifndef ROCKETMQ_EXAMPLE_ARGHELPER_H_
+#define ROCKETMQ_EXAMPLE_ARGHELPER_H_
 
 #include <string>
 #include <vector>
@@ -28,14 +28,15 @@ class ROCKETMQCLIENT_API ArgHelper {
  public:
   ArgHelper(int argc, char* argv[]);
   ArgHelper(std::string arg_str_);
+
   std::string get_option(int idx_) const;
   bool is_enable_option(std::string opt_) const;
   std::string get_option_value(std::string opt_) const;
 
  private:
-  std::vector<std::string> m_args;
+  std::vector<std::string> args_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __ARG_HELPER_H__
+#endif  // ROCKETMQ_EXAMPLE_ARGHELPER_H_
diff --git a/example/AsyncProducer.cpp b/example/AsyncProducer.cpp
index 130bc67..9a5ea45 100644
--- a/example/AsyncProducer.cpp
+++ b/example/AsyncProducer.cpp
@@ -47,7 +47,7 @@ class MyAutoDeleteSendCallback : public AutoDeleteSendCallback {
 };
 
 void AsyncProducerWorker(RocketmqSendAndConsumerArgs* info, DefaultMQProducer* producer) {
-  while (g_msgCount.fetch_sub(1) > 0) {
+  while (g_msg_count.fetch_sub(1) > 0) {
     MQMessage msg(info->topic,  // topic
                   "*",          // tag
                   info->body);  // body
@@ -75,14 +75,14 @@ int main(int argc, char* argv[]) {
   producer->setGroupName(info.groupname);
   producer->setSendMsgTimeout(3000);
   producer->setRetryTimes(info.retrytimes);
-  producer->setRetryTimes4Async(info.retrytimes);
+  producer->setRetryTimesForAsync(info.retrytimes);
   producer->setSendLatencyFaultEnable(!info.selectUnactiveBroker);
   producer->setTcpTransportTryLockTimeout(1000);
   producer->setTcpTransportConnectTimeout(400);
   producer->start();
 
   std::vector<std::shared_ptr<std::thread>> work_pool;
-  int msgcount = g_msgCount.load();
+  int msgcount = g_msg_count.load();
   g_finish = new latch(msgcount);
   g_tps.start();
 
diff --git a/example/BatchProducer.cpp b/example/BatchProducer.cpp
index 7ed4cb7..68883e3 100644
--- a/example/BatchProducer.cpp
+++ b/example/BatchProducer.cpp
@@ -22,7 +22,7 @@ using namespace rocketmq;
 TpsReportService g_tps;
 
 void SyncProducerWorker(RocketmqSendAndConsumerArgs* info, DefaultMQProducer* producer) {
-  while (g_msgCount.fetch_sub(1) > 0) {
+  while (g_msg_count.fetch_sub(1) > 0) {
     std::vector<MQMessage> msgs;
     MQMessage msg1(info->topic, "*", info->body);
     msg1.putProperty("property1", "value1");
@@ -67,14 +67,14 @@ int main(int argc, char* argv[]) {
   producer->setGroupName(info.groupname);
   producer->setSendMsgTimeout(3000);
   producer->setRetryTimes(info.retrytimes);
-  producer->setRetryTimes4Async(info.retrytimes);
+  producer->setRetryTimesForAsync(info.retrytimes);
   producer->setSendLatencyFaultEnable(!info.selectUnactiveBroker);
   producer->setTcpTransportTryLockTimeout(1000);
   producer->setTcpTransportConnectTimeout(400);
   producer->start();
 
   std::vector<std::shared_ptr<std::thread>> work_pool;
-  int msgcount = g_msgCount.load();
+  int msgcount = g_msg_count.load();
   g_tps.start();
 
   auto start = std::chrono::system_clock::now();
diff --git a/example/OrderlyProducer.cpp b/example/OrderlyProducer.cpp
index b0b602b..45538ba 100644
--- a/example/OrderlyProducer.cpp
+++ b/example/OrderlyProducer.cpp
@@ -33,7 +33,7 @@ class SelectMessageQueueByHash : public MessageQueueSelector {
 SelectMessageQueueByHash g_mySelector;
 
 void ProducerWorker(RocketmqSendAndConsumerArgs* info, DefaultMQProducer* producer) {
-  while (g_msgCount.fetch_sub(1) > 0) {
+  while (g_msg_count.fetch_sub(1) > 0) {
     MQMessage msg(info->topic,  // topic
                   "*",          // tag
                   info->body);  // body
@@ -68,14 +68,14 @@ int main(int argc, char* argv[]) {
   producer->setGroupName(info.groupname);
   producer->setSendMsgTimeout(3000);
   producer->setRetryTimes(info.retrytimes);
-  producer->setRetryTimes4Async(info.retrytimes);
+  producer->setRetryTimesForAsync(info.retrytimes);
   producer->setSendLatencyFaultEnable(!info.selectUnactiveBroker);
   producer->setTcpTransportTryLockTimeout(1000);
   producer->setTcpTransportConnectTimeout(400);
   producer->start();
 
   std::vector<std::shared_ptr<std::thread>> work_pool;
-  int msgcount = g_msgCount.load();
+  int msgcount = g_msg_count.load();
   g_tps.start();
 
   auto start = std::chrono::system_clock::now();
diff --git a/example/OrderlyPushConsumer.cpp b/example/OrderlyPushConsumer.cpp
index edb3563..02887c6 100644
--- a/example/OrderlyPushConsumer.cpp
+++ b/example/OrderlyPushConsumer.cpp
@@ -29,7 +29,7 @@ class MyMsgListener : public MessageListenerOrderly {
   virtual ~MyMsgListener() {}
 
   virtual ConsumeStatus consumeMessage(std::vector<MQMessageExt>& msgs) override {
-    auto old = g_msgCount.fetch_sub(msgs.size());
+    auto old = g_msg_count.fetch_sub(msgs.size());
     if (old > 0) {
       for (size_t i = 0; i < msgs.size(); ++i) {
         g_tps.Increment();
diff --git a/example/PullConsumer.cpp b/example/PullConsumer.cpp
index d1eab5e..f376201 100644
--- a/example/PullConsumer.cpp
+++ b/example/PullConsumer.cpp
@@ -78,7 +78,7 @@ int main(int argc, char* argv[]) {
     do {
       try {
         PullResult result = consumer.pull(mq, "*", getMessageQueueOffset(mq), 32);
-        g_msgCount += result.msg_found_list().size();
+        g_msg_count += result.msg_found_list().size();
         std::cout << result.msg_found_list().size() << std::endl;
         // if pull request timeout or received NULL response, pullStatus will be
         // setted to BROKER_TIMEOUT,
@@ -110,8 +110,8 @@ int main(int argc, char* argv[]) {
   auto end = std::chrono::system_clock::now();
   auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
 
-  std::cout << "msg count: " << g_msgCount.load() << "\n";
-  std::cout << "per msg time: " << duration.count() / (double)g_msgCount.load() << "ms \n"
+  std::cout << "msg count: " << g_msg_count.load() << "\n";
+  std::cout << "per msg time: " << duration.count() / (double)g_msg_count.load() << "ms \n"
             << "========================finished==============================\n";
 
   consumer.shutdown();
diff --git a/example/PushConsumer.cpp b/example/PushConsumer.cpp
index aa3b9cb..ff9c055 100644
--- a/example/PushConsumer.cpp
+++ b/example/PushConsumer.cpp
@@ -29,7 +29,7 @@ class MyMsgListener : public MessageListenerConcurrently {
   virtual ~MyMsgListener() = default;
 
   ConsumeStatus consumeMessage(std::vector<MQMessageExt>& msgs) override {
-    auto old = g_msgCount.fetch_sub(msgs.size());
+    auto old = g_msg_count.fetch_sub(msgs.size());
     if (old > 0) {
       for (size_t i = 0; i < msgs.size(); ++i) {
         g_tps.Increment();
diff --git a/example/RequestReply.cpp b/example/RequestReply.cpp
index 8fb7a3c..6564183 100644
--- a/example/RequestReply.cpp
+++ b/example/RequestReply.cpp
@@ -63,7 +63,7 @@ int main(int argc, char* argv[]) {
   producer.setNamesrvAddr(info.namesrv);
   producer.setSendMsgTimeout(3000);
   producer.setRetryTimes(info.retrytimes);
-  producer.setRetryTimes4Async(info.retrytimes);
+  producer.setRetryTimesForAsync(info.retrytimes);
   producer.setSendLatencyFaultEnable(!info.selectUnactiveBroker);
   producer.setTcpTransportTryLockTimeout(1000);
   producer.setTcpTransportConnectTimeout(400);
@@ -93,7 +93,7 @@ int main(int argc, char* argv[]) {
 
   // std::this_thread::sleep_for(std::chrono::seconds(10));
 
-  int msg_count = g_msgCount.load();
+  int msg_count = g_msg_count.load();
   for (int count = 0; count < msg_count; count++) {
     try {
       MQMessage msg(info.topic, "Hello world");
diff --git a/example/SyncProducer.cpp b/example/SyncProducer.cpp
index 69b71a8..69461ee 100644
--- a/example/SyncProducer.cpp
+++ b/example/SyncProducer.cpp
@@ -22,7 +22,7 @@ using namespace rocketmq;
 TpsReportService g_tps;
 
 void SyncProducerWorker(RocketmqSendAndConsumerArgs* info, DefaultMQProducer* producer) {
-  while (g_msgCount.fetch_sub(1) > 0) {
+  while (g_msg_count.fetch_sub(1) > 0) {
     MQMessage msg(info->topic,  // topic
                   "*",          // tag
                   info->body);  // body
@@ -56,14 +56,14 @@ int main(int argc, char* argv[]) {
   producer->setGroupName(info.groupname);
   producer->setSendMsgTimeout(3000);
   producer->setRetryTimes(info.retrytimes);
-  producer->setRetryTimes4Async(info.retrytimes);
+  producer->setRetryTimesForAsync(info.retrytimes);
   producer->setSendLatencyFaultEnable(!info.selectUnactiveBroker);
   producer->setTcpTransportTryLockTimeout(1000);
   producer->setTcpTransportConnectTimeout(400);
   producer->start();
 
   std::vector<std::shared_ptr<std::thread>> work_pool;
-  int msgcount = g_msgCount.load();
+  int msgcount = g_msg_count.load();
   g_tps.start();
 
   auto start = std::chrono::system_clock::now();
diff --git a/example/TransactionProducer.cpp b/example/TransactionProducer.cpp
index bddb559..ac2e286 100644
--- a/example/TransactionProducer.cpp
+++ b/example/TransactionProducer.cpp
@@ -36,7 +36,7 @@ class MyTransactionListener : public TransactionListener {
 };
 
 void SyncProducerWorker(RocketmqSendAndConsumerArgs* info, TransactionMQProducer* producer) {
-  int old = g_msgCount.fetch_sub(1);
+  int old = g_msg_count.fetch_sub(1);
   while (old > 0) {
     MQMessage msg(info->topic,  // topic
                   "*",          // tag
@@ -57,7 +57,7 @@ void SyncProducerWorker(RocketmqSendAndConsumerArgs* info, TransactionMQProducer
     } catch (const MQException& e) {
       std::cout << "send failed: " << e.what() << std::endl;
     }
-    old = g_msgCount.fetch_sub(1);
+    old = g_msg_count.fetch_sub(1);
   }
 }
 
@@ -73,7 +73,7 @@ int main(int argc, char* argv[]) {
   producer->setGroupName(info.groupname);
   producer->setSendMsgTimeout(3000);
   producer->setRetryTimes(info.retrytimes);
-  producer->setRetryTimes4Async(info.retrytimes);
+  producer->setRetryTimesForAsync(info.retrytimes);
   producer->setSendLatencyFaultEnable(!info.selectUnactiveBroker);
   producer->setTcpTransportTryLockTimeout(1000);
   producer->setTcpTransportConnectTimeout(400);
@@ -84,7 +84,7 @@ int main(int argc, char* argv[]) {
   producer->start();
 
   std::vector<std::shared_ptr<std::thread>> work_pool;
-  int msgcount = g_msgCount.load();
+  int msgcount = g_msg_count.load();
   g_tps.start();
 
   auto start = std::chrono::system_clock::now();
diff --git a/example/common.h b/example/common.h
index 393fda0..e3435ad 100644
--- a/example/common.h
+++ b/example/common.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef ROCKETMQ_CLIENT4CPP_EXAMPLE_COMMON_H_
-#define ROCKETMQ_CLIENT4CPP_EXAMPLE_COMMON_H_
+#ifndef ROCKETMQ_EXAMPLE_COMMON_H_
+#define ROCKETMQ_EXAMPLE_COMMON_H_
 
 #include <atomic>
 #include <chrono>
@@ -33,7 +33,7 @@
 
 #include "PullResult.h"
 
-static std::atomic<int> g_msgCount(1);
+static std::atomic<int> g_msg_count(1);
 
 class RocketmqSendAndConsumerArgs {
  public:
@@ -126,7 +126,7 @@ static void PrintRocketmqSendAndConsumerArgs(const RocketmqSendAndConsumerArgs&
             << "topic: " << info.topic << std::endl
             << "groupname: " << info.groupname << std::endl
             << "produce content: " << info.body << std::endl
-            << "msg count: " << g_msgCount.load() << std::endl
+            << "msg count: " << g_msg_count.load() << std::endl
             << "thread count: " << info.thread_count << std::endl;
 }
 
@@ -160,7 +160,7 @@ static bool ParseArgs(int argc, char* argv[], RocketmqSendAndConsumerArgs* info)
         info->topic.insert(0, optarg);
         break;
       case 'm':
-        g_msgCount.store(atoi(optarg));
+        g_msg_count.store(atoi(optarg));
         break;
       case 'c':
         info->body.insert(0, optarg);
@@ -208,7 +208,7 @@ static bool ParseArgs(int argc, char* argv[], RocketmqSendAndConsumerArgs* info)
     info->thread_count = thread_count;
   }
   info->printMoreInfo = atoi(arg_help.get_option_value("-v").c_str());
-  g_msgCount = atoi(arg_help.get_option_value("-m").c_str());
+  g_msg_count = atoi(arg_help.get_option_value("-m").c_str());
 #endif
   if (info->groupname.empty() || info->topic.empty() || info->namesrv.empty()) {
     std::cout << "please use -g to setup groupname and -t setup topic \n";
@@ -218,4 +218,4 @@ static bool ParseArgs(int argc, char* argv[], RocketmqSendAndConsumerArgs* info)
   return true;
 }
 
-#endif  // ROCKETMQ_CLIENT4CPP_EXAMPLE_COMMON_H_
+#endif  // ROCKETMQ_EXAMPLE_COMMON_H_
diff --git a/include/AllocateMQStrategy.h b/include/AllocateMQStrategy.h
index 4f60b29..56c497d 100644
--- a/include/AllocateMQStrategy.h
+++ b/include/AllocateMQStrategy.h
@@ -25,7 +25,7 @@
 namespace rocketmq {
 
 /**
- * AllocateMQStrategy - Interface of allocate MessageQueue
+ * AllocateMQStrategy - Interface for allocate MessageQueue
  */
 class ROCKETMQCLIENT_API AllocateMQStrategy {
  public:
diff --git a/include/Array.h b/include/Array.h
index daa4866..c1059cf 100644
--- a/include/Array.h
+++ b/include/Array.h
@@ -44,7 +44,7 @@ template <typename T>
 using array_element_t = typename array_traits<T>::element_type;
 
 template <typename T>
-class Array {
+class ROCKETMQCLIENT_API Array {
  public:
   using element_type = array_element_t<T>;
 
diff --git a/include/ConsumeType.h b/include/ConsumeType.h
index ab54829..fe51bb1 100644
--- a/include/ConsumeType.h
+++ b/include/ConsumeType.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __CONSUME_TYPE_H__
-#define __CONSUME_TYPE_H__
+#ifndef ROCKETMQ_CONSUMETYPE_H_
+#define ROCKETMQ_CONSUMETYPE_H_
 
 namespace rocketmq {
 
@@ -60,4 +60,4 @@ enum MessageModel {
 
 }  // namespace rocketmq
 
-#endif  // __CONSUME_TYPE_H__
+#endif  // ROCKETMQ_CONSUMETYPE_H_
diff --git a/include/DefaultMQProducer.h b/include/DefaultMQProducer.h
index f0baf01..6405d64 100644
--- a/include/DefaultMQProducer.h
+++ b/include/DefaultMQProducer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PRODUCER_H__
-#define __DEFAULT_MQ_PRODUCER_H__
+#ifndef ROCKETMQ_DEFAULTMQPRODUCER_H_
+#define ROCKETMQ_DEFAULTMQPRODUCER_H_
 
 #include "DefaultMQProducerConfigProxy.h"
 #include "MQProducer.h"
@@ -23,7 +23,9 @@
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API DefaultMQProducer : public MQProducer, public DefaultMQProducerConfigProxy {
+class ROCKETMQCLIENT_API DefaultMQProducer : public DefaultMQProducerConfigProxy,  // base
+                                             public MQProducer                     // interface
+{
  public:
   DefaultMQProducer(const std::string& groupname);
   DefaultMQProducer(const std::string& groupname, RPCHookPtr rpcHook);
@@ -98,4 +100,4 @@ class ROCKETMQCLIENT_API DefaultMQProducer : public MQProducer, public DefaultMQ
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PRODUCER_H__
+#endif  // ROCKETMQ_DEFAULTMQPRODUCER_H_
diff --git a/include/DefaultMQProducerConfig.h b/include/DefaultMQProducerConfig.h
index fe396ee..dcee17a 100644
--- a/include/DefaultMQProducerConfig.h
+++ b/include/DefaultMQProducerConfig.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PRODUCER_CONFIG_H__
-#define __DEFAULT_MQ_PRODUCER_CONFIG_H__
+#ifndef ROCKETMQ_DEFAULTMQPRODUCERCONFIG_H_
+#define ROCKETMQ_DEFAULTMQPRODUCERCONFIG_H_
 
 #include "MQClientConfig.h"
 
@@ -24,7 +24,11 @@ namespace rocketmq {
 class DefaultMQProducerConfig;
 typedef std::shared_ptr<DefaultMQProducerConfig> DefaultMQProducerConfigPtr;
 
-class ROCKETMQCLIENT_API DefaultMQProducerConfig : virtual public MQClientConfig {
+/**
+ * DefaultMQProducerConfig - config interface for DefaultMQProducer
+ */
+class ROCKETMQCLIENT_API DefaultMQProducerConfig : virtual public MQClientConfig  // base interface
+{
  public:
   virtual ~DefaultMQProducerConfig() = default;
 
@@ -50,8 +54,8 @@ class ROCKETMQCLIENT_API DefaultMQProducerConfig : virtual public MQClientConfig
   virtual int getRetryTimes() const = 0;
   virtual void setRetryTimes(int times) = 0;
 
-  virtual int getRetryTimes4Async() const = 0;
-  virtual void setRetryTimes4Async(int times) = 0;
+  virtual int getRetryTimesForAsync() const = 0;
+  virtual void setRetryTimesForAsync(int times) = 0;
 
   virtual bool isRetryAnotherBrokerWhenNotStoreOK() const = 0;
   virtual void setRetryAnotherBrokerWhenNotStoreOK(bool retryAnotherBrokerWhenNotStoreOK) = 0;
@@ -62,4 +66,4 @@ class ROCKETMQCLIENT_API DefaultMQProducerConfig : virtual public MQClientConfig
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PRODUCER_CONFIG_H__
+#endif  // ROCKETMQ_DEFAULTMQPRODUCERCONFIG_H_
diff --git a/include/DefaultMQProducerConfigProxy.h b/include/DefaultMQProducerConfigProxy.h
index 522decf..deeb879 100644
--- a/include/DefaultMQProducerConfigProxy.h
+++ b/include/DefaultMQProducerConfigProxy.h
@@ -14,67 +14,95 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PRODUCER_CONFI_PROXY_H__
-#define __DEFAULT_MQ_PRODUCER_CONFI_PROXY_H__
+#ifndef ROCKETMQ_DEFAULTMQPRODUCERCONFIPROXY_H_
+#define ROCKETMQ_DEFAULTMQPRODUCERCONFIPROXY_H_
 
 #include "DefaultMQProducerConfig.h"
 #include "MQClientConfigProxy.h"
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API DefaultMQProducerConfigProxy : virtual public DefaultMQProducerConfig,
-                                                        public MQClientConfigProxy {
+/**
+ * DefaultMQProducerConfigProxy - proxy for DefaultMQProducerConfig
+ */
+class ROCKETMQCLIENT_API DefaultMQProducerConfigProxy : public MQClientConfigProxy,             // base
+                                                        virtual public DefaultMQProducerConfig  // interface
+{
  public:
-  DefaultMQProducerConfigProxy(DefaultMQProducerConfigPtr producerConfig)
-      : MQClientConfigProxy(producerConfig), m_producerConfig(producerConfig) {}
+  DefaultMQProducerConfigProxy(DefaultMQProducerConfigPtr producerConfig) : MQClientConfigProxy(producerConfig) {}
   virtual ~DefaultMQProducerConfigProxy() = default;
 
-  DefaultMQProducerConfigPtr getRealConfig() const { return m_producerConfig; }
-
-  int getMaxMessageSize() const override { return m_producerConfig->getMaxMessageSize(); }
+  inline int getMaxMessageSize() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->getMaxMessageSize();
+  }
 
-  void setMaxMessageSize(int maxMessageSize) override { m_producerConfig->setMaxMessageSize(maxMessageSize); }
+  inline void setMaxMessageSize(int maxMessageSize) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->setMaxMessageSize(maxMessageSize);
+  }
 
-  int getCompressMsgBodyOverHowmuch() const override { return m_producerConfig->getCompressMsgBodyOverHowmuch(); }
+  inline int getCompressMsgBodyOverHowmuch() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->getCompressMsgBodyOverHowmuch();
+  }
 
-  void setCompressMsgBodyOverHowmuch(int compressMsgBodyOverHowmuch) override {
-    m_producerConfig->setCompressMsgBodyOverHowmuch(compressMsgBodyOverHowmuch);
+  inline void setCompressMsgBodyOverHowmuch(int compressMsgBodyOverHowmuch) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())
+        ->setCompressMsgBodyOverHowmuch(compressMsgBodyOverHowmuch);
   }
 
-  int getCompressLevel() const override { return m_producerConfig->getCompressLevel(); }
+  inline int getCompressLevel() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->getCompressLevel();
+  }
 
-  void setCompressLevel(int compressLevel) override { m_producerConfig->setCompressLevel(compressLevel); }
+  inline void setCompressLevel(int compressLevel) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->setCompressLevel(compressLevel);
+  }
 
-  int getSendMsgTimeout() const override { return m_producerConfig->getSendMsgTimeout(); }
+  inline int getSendMsgTimeout() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->getSendMsgTimeout();
+  }
 
-  void setSendMsgTimeout(int sendMsgTimeout) override { m_producerConfig->setSendMsgTimeout(sendMsgTimeout); }
+  inline void setSendMsgTimeout(int sendMsgTimeout) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->setSendMsgTimeout(sendMsgTimeout);
+  }
 
-  int getRetryTimes() const override { return m_producerConfig->getRetryTimes(); }
+  inline int getRetryTimes() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->getRetryTimes();
+  }
 
-  void setRetryTimes(int times) override { m_producerConfig->setRetryTimes(times); }
+  inline void setRetryTimes(int times) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->setRetryTimes(times);
+  }
 
-  int getRetryTimes4Async() const override { return m_producerConfig->getRetryTimes4Async(); }
+  inline int getRetryTimesForAsync() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->getRetryTimesForAsync();
+  }
 
-  void setRetryTimes4Async(int times) override { m_producerConfig->setRetryTimes4Async(times); }
+  inline void setRetryTimesForAsync(int times) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->setRetryTimesForAsync(times);
+  }
 
-  bool isRetryAnotherBrokerWhenNotStoreOK() const override {
-    return m_producerConfig->isRetryAnotherBrokerWhenNotStoreOK();
+  inline bool isRetryAnotherBrokerWhenNotStoreOK() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->isRetryAnotherBrokerWhenNotStoreOK();
   }
 
-  void setRetryAnotherBrokerWhenNotStoreOK(bool retryAnotherBrokerWhenNotStoreOK) override {
-    m_producerConfig->setRetryAnotherBrokerWhenNotStoreOK(retryAnotherBrokerWhenNotStoreOK);
+  inline void setRetryAnotherBrokerWhenNotStoreOK(bool retryAnotherBrokerWhenNotStoreOK) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())
+        ->setRetryAnotherBrokerWhenNotStoreOK(retryAnotherBrokerWhenNotStoreOK);
   }
 
-  bool isSendLatencyFaultEnable() const override { return m_producerConfig->isSendLatencyFaultEnable(); }
+  inline bool isSendLatencyFaultEnable() const override {
+    return dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->isSendLatencyFaultEnable();
+  }
 
-  void setSendLatencyFaultEnable(bool sendLatencyFaultEnable) override {
-    m_producerConfig->setSendLatencyFaultEnable(sendLatencyFaultEnable);
+  inline void setSendLatencyFaultEnable(bool sendLatencyFaultEnable) override {
+    dynamic_cast<DefaultMQProducerConfig*>(client_config_.get())->setSendLatencyFaultEnable(sendLatencyFaultEnable);
   }
 
- private:
-  DefaultMQProducerConfigPtr m_producerConfig;
+  inline DefaultMQProducerConfigPtr real_config() const {
+    return std::dynamic_pointer_cast<DefaultMQProducerConfig>(client_config_);
+  }
 };
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PRODUCER_CONFI_PROXY_H__
+#endif  // ROCKETMQ_DEFAULTMQPRODUCERCONFIPROXY_H_
diff --git a/include/DefaultMQPullConsumer.h b/include/DefaultMQPullConsumer.h
index 8b4c719..2f39e97 100755
--- a/include/DefaultMQPullConsumer.h
+++ b/include/DefaultMQPullConsumer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PULL_CONSUMER_H__
-#define __DEFAULT_MQ_PULL_CONSUMER_H__
+#ifndef ROCCKETMQ_DEFAULTMQPULLCONSUMER_H_
+#define ROCCKETMQ_DEFAULTMQPULLCONSUMER_H_
 
 #include <set>
 #include <string>
@@ -78,4 +78,4 @@ class ROCKETMQCLIENT_API DefaultMQPullConsumer : public MQPullConsumer, public D
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PULL_CONSUMER_H__
+#endif  // ROCCKETMQ_DEFAULTMQPULLCONSUMER_H_
diff --git a/include/DefaultMQPullConsumerConfig.h b/include/DefaultMQPullConsumerConfig.h
index 835c076..056e6d9 100644
--- a/include/DefaultMQPullConsumerConfig.h
+++ b/include/DefaultMQPullConsumerConfig.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PULL_CONSUMER_CONFIG_H__
-#define __DEFAULT_MQ_PULL_CONSUMER_CONFIG_H__
+#ifndef ROCKETMQ_DEFAULTMQPULLCONSUMERCONFIG_H_
+#define ROCKETMQ_DEFAULTMQPULLCONSUMERCONFIG_H_
 
 #include "AllocateMQStrategy.h"
 #include "ConsumeType.h"
@@ -39,4 +39,4 @@ class ROCKETMQCLIENT_API DefaultMQPullConsumerConfig : virtual public MQClientCo
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PULL_CONSUMER_CONFIG_H__
+#endif  // ROCKETMQ_DEFAULTMQPULLCONSUMERCONFIG_H_
diff --git a/include/DefaultMQPullConsumerConfigProxy.h b/include/DefaultMQPullConsumerConfigProxy.h
index 101acf4..63c73ec 100644
--- a/include/DefaultMQPullConsumerConfigProxy.h
+++ b/include/DefaultMQPullConsumerConfigProxy.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PULL_CONSUMER_CONFIG_PROXY_H__
-#define __DEFAULT_MQ_PULL_CONSUMER_CONFIG_PROXY_H__
+#ifndef ROCKETMQ_DEFAULTMQPULLCONSUMERCONFIGPROXY_H_
+#define ROCKETMQ_DEFAULTMQPULLCONSUMERCONFIGPROXY_H_
 
 #include "DefaultMQPullConsumerConfig.h"
 #include "MQClientConfigProxy.h"
@@ -45,4 +45,4 @@ class ROCKETMQCLIENT_API DefaultMQPullConsumerConfigProxy : virtual public Defau
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PULL_CONSUMER_CONFIG_PROXY_H__
+#endif  // ROCKETMQ_DEFAULTMQPULLCONSUMERCONFIGPROXY_H_
diff --git a/include/DefaultMQPushConsumer.h b/include/DefaultMQPushConsumer.h
index 6505712..b6276b4 100755
--- a/include/DefaultMQPushConsumer.h
+++ b/include/DefaultMQPushConsumer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PUSH_CONSUMER_H__
-#define __DEFAULT_MQ_PUSH_CONSUMER_H__
+#ifndef ROCKETMQ_DEFAULTMQPUSHCONSUMER_H_
+#define ROCKETMQ_DEFAULTMQPUSHCONSUMER_H_
 
 #include "DefaultMQPushConsumerConfigProxy.h"
 #include "MQPushConsumer.h"
@@ -23,7 +23,9 @@
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API DefaultMQPushConsumer : public MQPushConsumer, public DefaultMQPushConsumerConfigProxy {
+class ROCKETMQCLIENT_API DefaultMQPushConsumer : public DefaultMQPushConsumerConfigProxy,  // base
+                                                 public MQPushConsumer                     // interface
+{
  public:
   DefaultMQPushConsumer(const std::string& groupname);
   DefaultMQPushConsumer(const std::string& groupname, RPCHookPtr rpcHook);
@@ -58,4 +60,4 @@ class ROCKETMQCLIENT_API DefaultMQPushConsumer : public MQPushConsumer, public D
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PUSH_CONSUMER_H__
+#endif  // ROCKETMQ_DEFAULTMQPUSHCONSUMER_H_
diff --git a/include/DefaultMQPushConsumerConfig.h b/include/DefaultMQPushConsumerConfig.h
index 0c571cc..c154007 100644
--- a/include/DefaultMQPushConsumerConfig.h
+++ b/include/DefaultMQPushConsumerConfig.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_H__
-#define __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_H__
+#ifndef ROCKETMQ_DEFAULTMQPUSHCONSUMERCONFIG_H_
+#define ROCKETMQ_DEFAULTMQPUSHCONSUMERCONFIG_H_
 
 #include "AllocateMQStrategy.h"
 #include "ConsumeType.h"
@@ -26,7 +26,11 @@ namespace rocketmq {
 class DefaultMQPushConsumerConfig;
 typedef std::shared_ptr<DefaultMQPushConsumerConfig> DefaultMQPushConsumerConfigPtr;
 
-class ROCKETMQCLIENT_API DefaultMQPushConsumerConfig : virtual public MQClientConfig {
+/**
+ * DefaultMQPushConsumerConfig - config for DefaultMQPushConsumer
+ */
+class ROCKETMQCLIENT_API DefaultMQPushConsumerConfig : virtual public MQClientConfig  // base interface
+{
  public:
   virtual ~DefaultMQPushConsumerConfig() = default;
 
@@ -36,8 +40,8 @@ class ROCKETMQCLIENT_API DefaultMQPushConsumerConfig : virtual public MQClientCo
   virtual ConsumeFromWhere getConsumeFromWhere() const = 0;
   virtual void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) = 0;
 
-  virtual std::string getConsumeTimestamp() = 0;
-  virtual void setConsumeTimestamp(std::string consumeTimestamp) = 0;
+  virtual const std::string& getConsumeTimestamp() const = 0;
+  virtual void setConsumeTimestamp(const std::string& consumeTimestamp) = 0;
 
   /**
    * consuming thread count, default value is cpu cores
@@ -73,4 +77,4 @@ class ROCKETMQCLIENT_API DefaultMQPushConsumerConfig : virtual public MQClientCo
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_H__
+#endif  // ROCKETMQ_DEFAULTMQPUSHCONSUMERCONFIG_H_
diff --git a/include/DefaultMQPushConsumerConfigProxy.h b/include/DefaultMQPushConsumerConfigProxy.h
index ef0c4de..3ff22b3 100644
--- a/include/DefaultMQPushConsumerConfigProxy.h
+++ b/include/DefaultMQPushConsumerConfigProxy.h
@@ -14,83 +14,109 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_PROXY_H__
-#define __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_PROXY_H__
+#ifndef ROCKETMQ_DEFAULTMQPUSHCONSUMERCONFIGPROXY_H_
+#define ROCKETMQ_DEFAULTMQPUSHCONSUMERCONFIGPROXY_H_
 
 #include "DefaultMQPushConsumerConfig.h"
 #include "MQClientConfigProxy.h"
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API DefaultMQPushConsumerConfigProxy : virtual public DefaultMQPushConsumerConfig,
-                                                            public MQClientConfigProxy {
+class ROCKETMQCLIENT_API DefaultMQPushConsumerConfigProxy : public MQClientConfigProxy,                 // base
+                                                            virtual public DefaultMQPushConsumerConfig  // interface
+{
  public:
   DefaultMQPushConsumerConfigProxy(DefaultMQPushConsumerConfigPtr consumerConfig)
-      : MQClientConfigProxy(consumerConfig), m_consumerConfig(consumerConfig) {}
+      : MQClientConfigProxy(consumerConfig) {}
   virtual ~DefaultMQPushConsumerConfigProxy() = default;
 
-  DefaultMQPushConsumerConfigPtr getRealConfig() const { return m_consumerConfig; }
-
-  MessageModel getMessageModel() const override { return m_consumerConfig->getMessageModel(); }
+  inline MessageModel getMessageModel() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel();
+  }
 
-  void setMessageModel(MessageModel messageModel) override { m_consumerConfig->setMessageModel(messageModel); }
+  inline void setMessageModel(MessageModel messageModel) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setMessageModel(messageModel);
+  }
 
-  ConsumeFromWhere getConsumeFromWhere() const override { return m_consumerConfig->getConsumeFromWhere(); }
+  inline ConsumeFromWhere getConsumeFromWhere() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeFromWhere();
+  }
 
-  void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) override {
-    m_consumerConfig->setConsumeFromWhere(consumeFromWhere);
+  inline void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setConsumeFromWhere(consumeFromWhere);
   }
 
-  std::string getConsumeTimestamp() override { return m_consumerConfig->getConsumeTimestamp(); }
+  inline const std::string& getConsumeTimestamp() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeTimestamp();
+  }
 
-  void setConsumeTimestamp(std::string consumeTimestamp) override {
-    m_consumerConfig->setConsumeTimestamp(consumeTimestamp);
+  inline void setConsumeTimestamp(const std::string& consumeTimestamp) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setConsumeTimestamp(consumeTimestamp);
   }
 
-  int getConsumeThreadNum() const override { return m_consumerConfig->getConsumeThreadNum(); }
+  inline int getConsumeThreadNum() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeThreadNum();
+  }
 
-  void setConsumeThreadNum(int threadNum) override { return m_consumerConfig->setConsumeThreadNum(threadNum); }
+  inline void setConsumeThreadNum(int threadNum) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setConsumeThreadNum(threadNum);
+  }
 
-  int getConsumeMessageBatchMaxSize() const override { return m_consumerConfig->getConsumeMessageBatchMaxSize(); }
+  inline int getConsumeMessageBatchMaxSize() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeMessageBatchMaxSize();
+  }
 
-  void setConsumeMessageBatchMaxSize(int consumeMessageBatchMaxSize) override {
-    m_consumerConfig->setConsumeMessageBatchMaxSize(consumeMessageBatchMaxSize);
+  inline void setConsumeMessageBatchMaxSize(int consumeMessageBatchMaxSize) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())
+        ->setConsumeMessageBatchMaxSize(consumeMessageBatchMaxSize);
   }
 
-  int getMaxCacheMsgSizePerQueue() const override { return m_consumerConfig->getMaxCacheMsgSizePerQueue(); }
+  inline int getMaxCacheMsgSizePerQueue() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMaxCacheMsgSizePerQueue();
+  }
 
-  void setMaxCacheMsgSizePerQueue(int maxCacheSize) override {
-    m_consumerConfig->setMaxCacheMsgSizePerQueue(maxCacheSize);
+  inline void setMaxCacheMsgSizePerQueue(int maxCacheSize) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setMaxCacheMsgSizePerQueue(maxCacheSize);
   }
 
-  int getAsyncPullTimeout() const override { return m_consumerConfig->getAsyncPullTimeout(); }
+  inline int getAsyncPullTimeout() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getAsyncPullTimeout();
+  }
 
-  void setAsyncPullTimeout(int asyncPullTimeout) override { m_consumerConfig->setAsyncPullTimeout(asyncPullTimeout); }
+  inline void setAsyncPullTimeout(int asyncPullTimeout) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setAsyncPullTimeout(asyncPullTimeout);
+  }
 
-  int getMaxReconsumeTimes() const override { return m_consumerConfig->getMaxReconsumeTimes(); }
+  inline int getMaxReconsumeTimes() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMaxReconsumeTimes();
+  }
 
-  void setMaxReconsumeTimes(int maxReconsumeTimes) override {
-    m_consumerConfig->setMaxReconsumeTimes(maxReconsumeTimes);
+  inline void setMaxReconsumeTimes(int maxReconsumeTimes) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setMaxReconsumeTimes(maxReconsumeTimes);
   }
 
-  long getPullTimeDelayMillsWhenException() const override {
-    return m_consumerConfig->getPullTimeDelayMillsWhenException();
+  inline long getPullTimeDelayMillsWhenException() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getPullTimeDelayMillsWhenException();
   }
 
-  void setPullTimeDelayMillsWhenException(long pullTimeDelayMillsWhenException) override {
-    m_consumerConfig->setPullTimeDelayMillsWhenException(pullTimeDelayMillsWhenException);
+  inline void setPullTimeDelayMillsWhenException(long pullTimeDelayMillsWhenException) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())
+        ->setPullTimeDelayMillsWhenException(pullTimeDelayMillsWhenException);
   }
 
-  AllocateMQStrategy* getAllocateMQStrategy() const override { return m_consumerConfig->getAllocateMQStrategy(); }
+  inline AllocateMQStrategy* getAllocateMQStrategy() const override {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getAllocateMQStrategy();
+  }
 
-  void setAllocateMQStrategy(AllocateMQStrategy* strategy) override {
-    m_consumerConfig->setAllocateMQStrategy(strategy);
+  inline void setAllocateMQStrategy(AllocateMQStrategy* strategy) override {
+    dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->setAllocateMQStrategy(strategy);
   }
 
- private:
-  DefaultMQPushConsumerConfigPtr m_consumerConfig;
+  inline DefaultMQPushConsumerConfigPtr real_config() const {
+    return std::dynamic_pointer_cast<DefaultMQPushConsumerConfig>(client_config_);
+  }
 };
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_PROXY_H__
+#endif  // ROCKETMQ_DEFAULTMQPUSHCONSUMERCONFIGPROXY_H_
diff --git a/include/MQAdmin.h b/include/MQAdmin.h
index eb681fb..dff6f51 100644
--- a/include/MQAdmin.h
+++ b/include/MQAdmin.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_ADMIN_H__
-#define __MQ_ADMIN_H__
+#ifndef ROCKETMQ_MQADMIN_H_
+#define ROCKETMQ_MQADMIN_H_
 
 #include "MQMessageExt.h"
 #include "MQMessageQueue.h"
@@ -100,4 +100,4 @@ class ROCKETMQCLIENT_API MQAdmin {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_ADMIN_H__
+#endif  // ROCKETMQ_MQADMIN_H_
diff --git a/include/MQClientConfig.h b/include/MQClientConfig.h
index 9cc5bc6..c93dd2b 100644
--- a/include/MQClientConfig.h
+++ b/include/MQClientConfig.h
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_CONFIG_H__
-#define __MQ_CLIENT_CONFIG_H__
+#ifndef ROCKETMQ_MQCLIENTCONFIG_H_
+#define ROCKETMQ_MQCLIENTCONFIG_H_
 
-#include <memory>
-#include <string>
+#include <memory>  // std::shared_ptr
+#include <string>  // std::string
 
 #include "RocketMQClient.h"
 
@@ -28,7 +28,7 @@ class MQClientConfig;
 typedef std::shared_ptr<MQClientConfig> MQClientConfigPtr;
 
 /**
- * MQ Client Config
+ * MQClientConfig - config interface for MQClient
  */
 class ROCKETMQCLIENT_API MQClientConfig {
  public:
@@ -72,4 +72,4 @@ class ROCKETMQCLIENT_API MQClientConfig {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_CONFIG_H__
+#endif  // ROCKETMQ_MQCLIENTCONFIG_H_
diff --git a/include/MQClientConfigProxy.h b/include/MQClientConfigProxy.h
index 5714aad..2e3b332 100644
--- a/include/MQClientConfigProxy.h
+++ b/include/MQClientConfigProxy.h
@@ -14,60 +14,72 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_CONFIG_PROXY_H__
-#define __MQ_CLIENT_CONFIG_PROXY_H__
+#ifndef ROCKETMQ_MQCLIENTCONFIGPROXY_H_
+#define ROCKETMQ_MQCLIENTCONFIGPROXY_H_
 
 #include "MQClientConfig.h"
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API MQClientConfigProxy : virtual public MQClientConfig {
+/**
+ * MQClientConfigProxy - proxy for MQClientConfig
+ */
+class ROCKETMQCLIENT_API MQClientConfigProxy : virtual public MQClientConfig  // interface
+{
  public:
-  MQClientConfigProxy(MQClientConfigPtr clientConfig) : m_clientConfig(clientConfig) {}
+  MQClientConfigProxy(MQClientConfigPtr clientConfig) : client_config_(clientConfig) {}
   virtual ~MQClientConfigProxy() = default;
 
-  MQClientConfigPtr getRealConfig() const { return m_clientConfig; }
-
-  std::string buildMQClientId() const override { return m_clientConfig->buildMQClientId(); }
+  inline std::string buildMQClientId() const override { return client_config_->buildMQClientId(); }
 
-  const std::string& getGroupName() const override { return m_clientConfig->getGroupName(); }
+  inline const std::string& getGroupName() const override { return client_config_->getGroupName(); }
 
-  void setGroupName(const std::string& groupname) override { m_clientConfig->setGroupName(groupname); }
+  inline void setGroupName(const std::string& groupname) override { client_config_->setGroupName(groupname); }
 
-  const std::string& getNamesrvAddr() const override { return m_clientConfig->getNamesrvAddr(); }
+  inline const std::string& getNamesrvAddr() const override { return client_config_->getNamesrvAddr(); }
 
-  void setNamesrvAddr(const std::string& namesrvAddr) override { m_clientConfig->setNamesrvAddr(namesrvAddr); }
+  inline void setNamesrvAddr(const std::string& namesrvAddr) override { client_config_->setNamesrvAddr(namesrvAddr); }
 
-  const std::string& getInstanceName() const override { return m_clientConfig->getInstanceName(); }
+  inline const std::string& getInstanceName() const override { return client_config_->getInstanceName(); }
 
-  void setInstanceName(const std::string& instanceName) override { m_clientConfig->setInstanceName(instanceName); }
+  inline void setInstanceName(const std::string& instanceName) override {
+    client_config_->setInstanceName(instanceName);
+  }
 
-  void changeInstanceNameToPID() override { m_clientConfig->changeInstanceNameToPID(); }
+  inline void changeInstanceNameToPID() override { client_config_->changeInstanceNameToPID(); }
 
-  const std::string& getUnitName() const override { return m_clientConfig->getUnitName(); }
+  inline const std::string& getUnitName() const override { return client_config_->getUnitName(); }
 
-  void setUnitName(std::string unitName) override { m_clientConfig->setUnitName(unitName); }
+  inline void setUnitName(std::string unitName) override { client_config_->setUnitName(unitName); }
 
-  int getTcpTransportWorkerThreadNum() const override { return m_clientConfig->getTcpTransportWorkerThreadNum(); }
+  inline int getTcpTransportWorkerThreadNum() const override {
+    return client_config_->getTcpTransportWorkerThreadNum();
+  }
 
-  void setTcpTransportWorkerThreadNum(int num) override { m_clientConfig->setTcpTransportWorkerThreadNum(num); }
+  inline void setTcpTransportWorkerThreadNum(int num) override { client_config_->setTcpTransportWorkerThreadNum(num); }
 
-  uint64_t getTcpTransportConnectTimeout() const override { return m_clientConfig->getTcpTransportConnectTimeout(); }
+  inline uint64_t getTcpTransportConnectTimeout() const override {
+    return client_config_->getTcpTransportConnectTimeout();
+  }
 
-  void setTcpTransportConnectTimeout(uint64_t timeout) override {
-    m_clientConfig->setTcpTransportConnectTimeout(timeout);
+  inline void setTcpTransportConnectTimeout(uint64_t timeout) override {
+    client_config_->setTcpTransportConnectTimeout(timeout);
   }
 
-  uint64_t getTcpTransportTryLockTimeout() const override { return m_clientConfig->getTcpTransportTryLockTimeout(); }
+  inline uint64_t getTcpTransportTryLockTimeout() const override {
+    return client_config_->getTcpTransportTryLockTimeout();
+  }
 
-  void setTcpTransportTryLockTimeout(uint64_t timeout) override {
-    m_clientConfig->setTcpTransportTryLockTimeout(timeout);
+  inline void setTcpTransportTryLockTimeout(uint64_t timeout) override {
+    client_config_->setTcpTransportTryLockTimeout(timeout);
   }
 
- private:
-  MQClientConfigPtr m_clientConfig;
+  inline MQClientConfigPtr real_config() const { return client_config_; }
+
+ protected:
+  MQClientConfigPtr client_config_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_CONFIG_PROXY_H__
+#endif  // ROCKETMQ_MQCLIENTCONFIGPROXY_H_
diff --git a/include/MQConsumer.h b/include/MQConsumer.h
index 54ff576..49c0b48 100755
--- a/include/MQConsumer.h
+++ b/include/MQConsumer.h
@@ -14,18 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CONSUMER_H__
-#define __MQ_CONSUMER_H__
-
-#include <string>
-#include <vector>
+#ifndef ROCKETMQ_MQCONSUMER_H_
+#define ROCKETMQ_MQCONSUMER_H_
 
 #include "MQMessageExt.h"
 
 namespace rocketmq {
 
 /**
- * MQ Consumer API
+ * MQConsumer - interface for consumer
  */
 class ROCKETMQCLIENT_API MQConsumer {
  public:
@@ -42,4 +39,4 @@ class ROCKETMQCLIENT_API MQConsumer {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CONSUMER_H__
+#endif  // ROCKETMQ_MQCONSUMER_H_
diff --git a/include/MQClientException.h b/include/MQException.h
similarity index 79%
rename from include/MQClientException.h
rename to include/MQException.h
index 4e2498d..c3f14db 100644
--- a/include/MQClientException.h
+++ b/include/MQException.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_EXCEPTION_H__
-#define __MQ_CLIENT_EXCEPTION_H__
+#ifndef ROCKETMQ_MQEXCEPTION_H_
+#define ROCKETMQ_MQEXCEPTION_H_
 
 #include <exception>
 #include <ostream>
@@ -26,6 +26,9 @@
 
 namespace rocketmq {
 
+/**
+ * MQException - base exception
+ */
 class ROCKETMQCLIENT_API MQException : public std::exception {
  public:
   MQException(const std::string& msg, int error, const char* file, int line) noexcept
@@ -39,47 +42,47 @@ class ROCKETMQCLIENT_API MQException : public std::exception {
               int error,
               std::exception_ptr cause,
               const char* file,
-              int line) noexcept : m_type(type),
-                                   m_msg(msg),
-                                   m_error(error),
-                                   m_cause(cause),
-                                   m_file(file),
-                                   m_line(line) {}
+              int line) noexcept : type_(type),
+                                   msg_(msg),
+                                   error_(error),
+                                   cause_(cause),
+                                   file_(file),
+                                   line_(line) {}
 
   virtual ~MQException() noexcept = default;
 
   const char* what() const noexcept override {
-    if (m_what_.empty()) {
+    if (what_.empty()) {
       std::stringstream ss;
-      ss << "[" << m_type << "] msg: " << m_msg << ", error: " << m_error << ", in <" << m_file << ":" << m_line << ">";
-      m_what_ = ss.str();
+      ss << "[" << type_ << "] msg: " << msg_ << ", error: " << error_ << ", in <" << file_ << ":" << line_ << ">";
+      what_ = ss.str();
     }
-    return m_what_.c_str();
+    return what_.c_str();
   }
 
-  const char* GetType() const noexcept { return m_type.c_str(); }
+  const char* GetType() const noexcept { return type_.c_str(); }
 
-  const std::string& GetErrorMessage() const noexcept { return m_msg; }
-  const char* GetMsg() const noexcept { return m_msg.c_str(); }
+  const std::string& GetErrorMessage() const noexcept { return msg_; }
+  const char* GetMsg() const noexcept { return msg_.c_str(); }
 
-  int GetError() const noexcept { return m_error; }
+  int GetError() const noexcept { return error_; }
 
-  std::exception_ptr GetCause() const { return m_cause; }
+  std::exception_ptr GetCause() const { return cause_; }
 
-  const char* GetFile() const noexcept { return m_file.c_str(); }
-  int GetLine() const noexcept { return m_line; }
+  const char* GetFile() const noexcept { return file_.c_str(); }
+  int GetLine() const noexcept { return line_; }
 
  protected:
-  std::string m_type;
-  std::string m_msg;
-  int m_error;
+  std::string type_;
+  std::string msg_;
+  int error_;
 
-  std::exception_ptr m_cause;
+  std::exception_ptr cause_;
 
-  std::string m_file;
-  int m_line;
+  std::string file_;
+  int line_;
 
-  mutable std::string m_what_;
+  mutable std::string what_;
 };
 
 inline std::ostream& operator<<(std::ostream& os, const MQException& e) {
@@ -126,4 +129,4 @@ DEFINE_MQEXCEPTION(RequestTimeoutException)
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_EXCEPTION_H__
+#endif  // ROCKETMQ_MQEXCEPTION_H_
diff --git a/include/MQMessage.h b/include/MQMessage.h
index 5fc5776..c0786a7 100644
--- a/include/MQMessage.h
+++ b/include/MQMessage.h
@@ -25,7 +25,7 @@
 namespace rocketmq {
 
 /**
- * MQMessage - Reference of Message
+ * MQMessage - wrapper for Message
  */
 class ROCKETMQCLIENT_API MQMessage : virtual public Message  // interface
 {
diff --git a/include/MQMessageConst.h b/include/MQMessageConst.h
index 071d94d..a12561c 100644
--- a/include/MQMessageConst.h
+++ b/include/MQMessageConst.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_MESSAGE_CONST_H__
-#define __MQ_MESSAGE_CONST_H__
+#ifndef ROCKETMQ_MQMESSAGECONST_H_
+#define ROCKETMQ_MQMESSAGECONST_H_
 
 #include <string>  // std::string
 
@@ -68,4 +68,4 @@ class ROCKETMQCLIENT_API MQMessageConst {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_MESSAGE_CONST_H__
+#endif  // ROCKETMQ_MQMESSAGECONST_H_
diff --git a/include/MQMessageExt.h b/include/MQMessageExt.h
index a6d8723..8d49917 100644
--- a/include/MQMessageExt.h
+++ b/include/MQMessageExt.h
@@ -23,7 +23,7 @@
 namespace rocketmq {
 
 /**
- * MQMessageExt - Reference of MessageExt
+ * MQMessageExt - wrapper for MessageExt
  */
 class ROCKETMQCLIENT_API MQMessageExt : public MQMessage,          // base
                                         virtual public MessageExt  // interface
diff --git a/include/MQMessageListener.h b/include/MQMessageListener.h
index 11287f9..7db5c38 100644
--- a/include/MQMessageListener.h
+++ b/include/MQMessageListener.h
@@ -14,10 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MESSAGE_LISTENER_H__
-#define __MESSAGE_LISTENER_H__
-
-#include <limits.h>
+#ifndef ROCKETMQ_MQMESSAGELISTENER_H_
+#define ROCKETMQ_MQMESSAGELISTENER_H_
 
 #include "MQMessageExt.h"
 
@@ -32,6 +30,9 @@ enum ConsumeStatus {
 
 enum MessageListenerType { messageListenerDefaultly = 0, messageListenerOrderly = 1, messageListenerConcurrently = 2 };
 
+/**
+ * MQMessageListener - listener interface for MQPushConsumer
+ */
 class ROCKETMQCLIENT_API MQMessageListener {
  public:
   virtual ~MQMessageListener() = default;
@@ -41,11 +42,17 @@ class ROCKETMQCLIENT_API MQMessageListener {
   virtual ConsumeStatus consumeMessage(std::vector<MQMessageExt>& msgs) { return RECONSUME_LATER; };
 };
 
+/**
+ * MessageListenerConcurrently - listener interface for MQPushConsumer in Concurrently mode
+ */
 class ROCKETMQCLIENT_API MessageListenerConcurrently : virtual public MQMessageListener {
  public:
   MessageListenerType getMessageListenerType() override final { return messageListenerConcurrently; }
 };
 
+/**
+ * MessageListenerOrderly - listener interface for MQPushConsumer in Orderly mode
+ */
 class ROCKETMQCLIENT_API MessageListenerOrderly : virtual public MQMessageListener {
  public:
   MessageListenerType getMessageListenerType() override final { return messageListenerOrderly; }
@@ -53,4 +60,4 @@ class ROCKETMQCLIENT_API MessageListenerOrderly : virtual public MQMessageListen
 
 }  // namespace rocketmq
 
-#endif  // __MESSAGE_LISTENER_H__
+#endif  // ROCKETMQ_MQMESSAGELISTENER_H_
diff --git a/include/MQMessageQueue.h b/include/MQMessageQueue.h
index bfe9fb9..42bd6e4 100644
--- a/include/MQMessageQueue.h
+++ b/include/MQMessageQueue.h
@@ -43,14 +43,14 @@ class ROCKETMQCLIENT_API MQMessageQueue {
   std::string toString() const;
 
  public:
-  inline const std::string& getTopic() const { return topic_; };
-  inline void setTopic(const std::string& topic) { topic_ = topic; };
+  inline const std::string& topic() const { return topic_; };
+  inline void set_topic(const std::string& topic) { topic_ = topic; };
 
-  inline const std::string& getBrokerName() const { return broker_name_; };
-  inline void setBrokerName(const std::string& broker_name) { broker_name_ = broker_name; };
+  inline const std::string& broker_name() const { return broker_name_; };
+  inline void set_broker_name(const std::string& broker_name) { broker_name_ = broker_name; };
 
-  inline int getQueueId() const { return queue_id_; };
-  inline void setQueueId(int queue_id) { queue_id_ = queue_id; };
+  inline int queue_id() const { return queue_id_; };
+  inline void set_queue_id(int queue_id) { queue_id_ = queue_id; };
 
  private:
   std::string topic_;
diff --git a/include/MQProducer.h b/include/MQProducer.h
index 69caaec..6fc281e 100644
--- a/include/MQProducer.h
+++ b/include/MQProducer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_PRODUCER_H__
-#define __MQ_PRODUCER_H__
+#ifndef ROCKETMQ_MQPRODUCER_H_
+#define ROCKETMQ_MQPRODUCER_H_
 
 #include "MQSelector.h"
 #include "RequestCallback.h"
@@ -26,7 +26,7 @@
 namespace rocketmq {
 
 /**
- * MQ Producer API
+ * MQProducer - interface for producer
  */
 class ROCKETMQCLIENT_API MQProducer {
  public:
@@ -87,4 +87,4 @@ class ROCKETMQCLIENT_API MQProducer {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_PRODUCER_H__
+#endif  // ROCKETMQ_MQPRODUCER_H_
diff --git a/include/MQPullConsumer.h b/include/MQPullConsumer.h
index 5571431..2545116 100644
--- a/include/MQPullConsumer.h
+++ b/include/MQPullConsumer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_PULL_CONSUMER_H__
-#define __MQ_PULL_CONSUMER_H__
+#ifndef ROCKETMQ_MQPULLCONSUMER_H_
+#define ROCKETMQ_MQPULLCONSUMER_H_
 
 #include "MQConsumer.h"
 #include "MQueueListener.h"
@@ -100,4 +100,4 @@ class ROCKETMQCLIENT_API MQPullConsumer : public MQConsumer {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_PULL_CONSUMER_H__
+#endif  // ROCKETMQ_MQPULLCONSUMER_H_
diff --git a/include/MQPushConsumer.h b/include/MQPushConsumer.h
index 8d59f09..0ee8aaa 100644
--- a/include/MQPushConsumer.h
+++ b/include/MQPushConsumer.h
@@ -14,15 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_PUSH_CONSUMER_H__
-#define __MQ_PUSH_CONSUMER_H__
+#ifndef ROCKETMQ_MQPUSHCONSUMER_H_
+#define ROCKETMQ_MQPUSHCONSUMER_H_
 
 #include "MQConsumer.h"
 #include "MQMessageListener.h"
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API MQPushConsumer : public MQConsumer {
+/**
+ * MQPushConsumer - interface for push consumer
+ */
+class ROCKETMQCLIENT_API MQPushConsumer : public MQConsumer  // base interface
+{
  public:  // MQPushConsumer in Java
   // [[deprecated]]
   virtual void registerMessageListener(MQMessageListener* messageListener) = 0;
@@ -40,4 +44,4 @@ class ROCKETMQCLIENT_API MQPushConsumer : public MQConsumer {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_PUSH_CONSUMER_H__
+#endif  // ROCKETMQ_MQPUSHCONSUMER_H_
diff --git a/include/MQSelector.h b/include/MQSelector.h
index f5de654..1a5a88f 100644
--- a/include/MQSelector.h
+++ b/include/MQSelector.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_SELECTOR_H__
-#define __MQ_SELECTOR_H__
+#ifndef ROCKETMQ_MQSELECTOR_H_
+#define ROCKETMQ_MQSELECTOR_H_
 
 #include "MQMessage.h"
 #include "MQMessageQueue.h"
@@ -23,7 +23,7 @@
 namespace rocketmq {
 
 /**
- * MQ Selector Interface
+ * MessageQueueSelector - interface for MessageQueue selector
  */
 class ROCKETMQCLIENT_API MessageQueueSelector {
  public:
@@ -34,4 +34,4 @@ class ROCKETMQCLIENT_API MessageQueueSelector {
 
 }  // namespace rocketmq
 
-#endif  // __MQ_SELECTOR_H__
+#endif  // ROCKETMQ_MQSELECTOR_H_
diff --git a/include/Message.h b/include/Message.h
index e4f21c4..fe6bd3c 100644
--- a/include/Message.h
+++ b/include/Message.h
@@ -30,7 +30,7 @@ class Message;
 typedef std::shared_ptr<Message> MessagePtr;
 
 /**
- * Message Interface
+ * Message - interface for messgae
  */
 class ROCKETMQCLIENT_API Message {
  public:
diff --git a/include/MessageExt.h b/include/MessageExt.h
index 172aa92..44b37a8 100644
--- a/include/MessageExt.h
+++ b/include/MessageExt.h
@@ -34,7 +34,7 @@ class MessageExt;
 typedef std::shared_ptr<MessageExt> MessageExtPtr;
 
 /**
- * MessageExt - Message extend class, which was generated on broker
+ * MessageExt - Message extend interface, which was generated on broker
  */
 class ROCKETMQCLIENT_API MessageExt : virtual public Message  // base interface
 {
diff --git a/include/MessageUtil.h b/include/MessageUtil.h
index ba21b70..f26d085 100644
--- a/include/MessageUtil.h
+++ b/include/MessageUtil.h
@@ -17,11 +17,14 @@
 #ifndef ROCKETMQ_MESSAGEUTIL_H_
 #define ROCKETMQ_MESSAGEUTIL_H_
 
-#include "MQClientException.h"
+#include "MQException.h"
 #include "MQMessage.h"
 
 namespace rocketmq {
 
+/**
+ * MessageUtil - util for Request-Reply mode
+ */
 class ROCKETMQCLIENT_API MessageUtil {
  public:
   static MQMessage createReplyMessage(const Message& requestMessage, const std::string& body);
diff --git a/include/AllocateMQStrategy.h b/include/OffsetStore.h
similarity index 54%
copy from include/AllocateMQStrategy.h
copy to include/OffsetStore.h
index 4f60b29..05ae0b4 100644
--- a/include/AllocateMQStrategy.h
+++ b/include/OffsetStore.h
@@ -14,29 +14,36 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef ROCKETMQ_ALLOCATEMQSTRATEGY_H_
-#define ROCKETMQ_ALLOCATEMQSTRATEGY_H_
+#ifndef ROCKETMQ_OFFSETSTORE_H_
+#define ROCKETMQ_OFFSETSTORE_H_
 
-#include <string>  // std::string
 #include <vector>  // std::vector
 
 #include "MQMessageQueue.h"
 
 namespace rocketmq {
 
-/**
- * AllocateMQStrategy - Interface of allocate MessageQueue
- */
-class ROCKETMQCLIENT_API AllocateMQStrategy {
+enum ReadOffsetType {
+  // read offset from memory
+  READ_FROM_MEMORY,
+  // read offset from remoting
+  READ_FROM_STORE,
+  // read offset from memory firstly, then from remoting
+  MEMORY_FIRST_THEN_STORE,
+};
+
+class ROCKETMQCLIENT_API OffsetStore {
  public:
-  virtual ~AllocateMQStrategy() = default;
+  virtual ~OffsetStore() = default;
 
-  virtual void allocate(const std::string& currentCID,
-                        std::vector<MQMessageQueue>& mqAll,
-                        std::vector<std::string>& cidAll,
-                        std::vector<MQMessageQueue>& outReuslt) = 0;
+  virtual void load() = 0;
+  virtual void updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) = 0;
+  virtual int64_t readOffset(const MQMessageQueue& mq, ReadOffsetType type) = 0;
+  virtual void persist(const MQMessageQueue& mq) = 0;
+  virtual void persistAll(const std::vector<MQMessageQueue>& mq) = 0;
+  virtual void removeOffset(const MQMessageQueue& mq) = 0;
 };
 
 }  // namespace rocketmq
 
-#endif  // __ALLOCATE_MQ_STRATEGY_H__
+#endif  // ROCKETMQ_CONSUMER_OFFSETSTORE_H_
diff --git a/include/PullCallback.h b/include/PullCallback.h
index 16fe81e..2e733e1 100755
--- a/include/PullCallback.h
+++ b/include/PullCallback.h
@@ -14,16 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PULL_CALLBACK_H__
-#define __PULL_CALLBACK_H__
+#ifndef ROCKETMQ_PULLCALLBACK_H_
+#define ROCKETMQ_PULLCALLBACK_H_
 
-#include "MQClientException.h"
+#include "MQException.h"
 #include "PullResult.h"
 
 namespace rocketmq {
 
 enum PullCallbackType { PULL_CALLBACK_TYPE_SIMPLE = 0, PULL_CALLBACK_TYPE_AUTO_DELETE = 1 };
 
+/**
+ * PullCallback - callback interface for async pull
+ */
 class ROCKETMQCLIENT_API PullCallback {
  public:
   virtual ~PullCallback() = default;
@@ -34,6 +37,11 @@ class ROCKETMQCLIENT_API PullCallback {
   virtual PullCallbackType getPullCallbackType() const { return PULL_CALLBACK_TYPE_SIMPLE; }
 };
 
+/**
+ * AutoDeletePullCallback - callback interface for async pull
+ *
+ * the object of AutoDeletePullCallback will be deleted automatically by SDK after invoke callback interface
+ */
 class ROCKETMQCLIENT_API AutoDeletePullCallback : public PullCallback {
  public:
   PullCallbackType getPullCallbackType() const override final { return PULL_CALLBACK_TYPE_AUTO_DELETE; }
@@ -41,4 +49,4 @@ class ROCKETMQCLIENT_API AutoDeletePullCallback : public PullCallback {
 
 }  // namespace rocketmq
 
-#endif  // __PULL_CALLBACK_H__
+#endif  // ROCKETMQ_PULLCALLBACK_H_
diff --git a/include/QueryResult.h b/include/QueryResult.h
index 1939fd3..b24d9e0 100644
--- a/include/QueryResult.h
+++ b/include/QueryResult.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __QUERY_RESULT_H__
-#define __QUERY_RESULT_H__
+#ifndef ROCKETMQ_QUERYRESULT_H_
+#define ROCKETMQ_QUERYRESULT_H_
 
 #include "MQMessageExt.h"
 
@@ -39,4 +39,4 @@ class ROCKETMQCLIENT_API QueryResult {
 
 }  // namespace rocketmq
 
-#endif  // __QUERY_RESULT_H__
+#endif  // ROCKETMQ_QUERYRESULT_H_
diff --git a/include/RemotingCommand.h b/include/RemotingCommand.h
index 6ad14e8..68847b3 100644
--- a/include/RemotingCommand.h
+++ b/include/RemotingCommand.h
@@ -25,10 +25,13 @@
 
 #include "ByteArray.h"
 #include "CommandCustomHeader.h"
-#include "MQClientException.h"
+#include "MQException.h"
 
 namespace rocketmq {
 
+/**
+ * RemotingCommand - rocketmq rpc protocol
+ */
 class ROCKETMQCLIENT_API RemotingCommand {
  public:
   static int32_t createNewRequestId();
diff --git a/include/RequestCallback.h b/include/RequestCallback.h
index d79e955..a6dfec4 100644
--- a/include/RequestCallback.h
+++ b/include/RequestCallback.h
@@ -14,30 +14,34 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __REQUEST_CALLBACK_H__
-#define __REQUEST_CALLBACK_H__
+#ifndef ROCKETMQ_REQUESTCALLBACK_H_
+#define ROCKETMQ_REQUESTCALLBACK_H_
 
-#include "MQClientException.h"
+#include "MQException.h"
 #include "MQMessage.h"
 
 namespace rocketmq {
 
 enum RequestCallbackType { REQUEST_CALLBACK_TYPE_SIMPLE = 0, REQUEST_CALLBACK_TYPE_AUTO_DELETE = 1 };
 
+/**
+ * RequestCallback - callback interface for async request
+ */
 class ROCKETMQCLIENT_API RequestCallback {
  public:
   virtual ~RequestCallback() = default;
 
-  virtual void onSuccess(MessagePtr message) { onSuccess(MQMessage(message)); }
-
-  // SDK will be responsible for the lifecycle of message.
   virtual void onSuccess(MQMessage message) = 0;
-
   virtual void onException(MQException& e) noexcept = 0;
 
   virtual RequestCallbackType getRequestCallbackType() const { return REQUEST_CALLBACK_TYPE_SIMPLE; }
 };
 
+/**
+ * AutoDeleteRequestCallback - callback interface for async request
+ *
+ * the object of AutoDeleteRequestCallback will be deleted automatically by SDK after invoke callback interface
+ */
 class ROCKETMQCLIENT_API AutoDeleteRequestCallback : public RequestCallback {
  public:
   RequestCallbackType getRequestCallbackType() const override final { return REQUEST_CALLBACK_TYPE_AUTO_DELETE; }
@@ -45,4 +49,4 @@ class ROCKETMQCLIENT_API AutoDeleteRequestCallback : public RequestCallback {
 
 }  // namespace rocketmq
 
-#endif  // __REQUEST_CALLBACK_H__
+#endif  // ROCKETMQ_REQUESTCALLBACK_H_
diff --git a/include/SendCallback.h b/include/SendCallback.h
index e01f513..4801891 100755
--- a/include/SendCallback.h
+++ b/include/SendCallback.h
@@ -14,16 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SEND_CALLBACK_H__
-#define __SEND_CALLBACK_H__
+#ifndef ROCKETMQ_SENDCALLBACK_H_
+#define ROCKETMQ_SENDCALLBACK_H_
 
-#include "MQClientException.h"
+#include "MQException.h"
 #include "SendResult.h"
 
 namespace rocketmq {
 
 enum SendCallbackType { SEND_CALLBACK_TYPE_SIMPLE = 0, SEND_CALLBACK_TYPE_AUTO_DELETE = 1 };
 
+/**
+ * SendCallback - callback interface for async send
+ */
 class ROCKETMQCLIENT_API SendCallback {
  public:
   virtual ~SendCallback() = default;
@@ -34,12 +37,17 @@ class ROCKETMQCLIENT_API SendCallback {
   virtual SendCallbackType getSendCallbackType() const { return SEND_CALLBACK_TYPE_SIMPLE; }
 };
 
-// async SendCallback will be deleted automatically by rocketmq cpp after invoke callback interface
-class ROCKETMQCLIENT_API AutoDeleteSendCallback : public SendCallback {
+/**
+ * AutoDeleteSendCallback - callback interface for async send
+ *
+ * the object of AutoDeleteSendCallback will be deleted automatically by SDK after invoke callback interface
+ */
+class ROCKETMQCLIENT_API AutoDeleteSendCallback : public SendCallback  // base interface
+{
  public:
   SendCallbackType getSendCallbackType() const override final { return SEND_CALLBACK_TYPE_AUTO_DELETE; }
 };
 
 }  // namespace rocketmq
 
-#endif  // __SEND_CALLBACK_H__
+#endif  // ROCKETMQ_SENDCALLBACK_H_
diff --git a/include/SendResult.h b/include/SendResult.h
index 1a713ba..9188222 100644
--- a/include/SendResult.h
+++ b/include/SendResult.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SEND_RESULT_H__
-#define __SEND_RESULT_H__
+#ifndef ROCKETMQ_SENDRESULT_H_
+#define ROCKETMQ_SENDRESULT_H_
 
 #include "MQMessageQueue.h"
 
@@ -26,38 +26,64 @@ enum SendStatus { SEND_OK, SEND_FLUSH_DISK_TIMEOUT, SEND_FLUSH_SLAVE_TIMEOUT, SE
 
 class ROCKETMQCLIENT_API SendResult {
  public:
-  SendResult();
+  SendResult() : send_status_(SEND_OK), queue_offset_(0) {}
+
   SendResult(const SendStatus& sendStatus,
              const std::string& msgId,
              const std::string& offsetMsgId,
              const MQMessageQueue& messageQueue,
-             int64_t queueOffset);
+             int64_t queueOffset)
+      : send_status_(sendStatus),
+        msg_id_(msgId),
+        offset_msg_id_(offsetMsgId),
+        message_queue_(messageQueue),
+        queue_offset_(queueOffset) {}
+
+  SendResult(const SendResult& other) {
+    send_status_ = other.send_status_;
+    msg_id_ = other.msg_id_;
+    offset_msg_id_ = other.offset_msg_id_;
+    message_queue_ = other.message_queue_;
+    queue_offset_ = other.queue_offset_;
+  }
+
+  SendResult& operator=(const SendResult& other) {
+    if (this != &other) {
+      send_status_ = other.send_status_;
+      msg_id_ = other.msg_id_;
+      offset_msg_id_ = other.offset_msg_id_;
+      message_queue_ = other.message_queue_;
+      queue_offset_ = other.queue_offset_;
+    }
+    return *this;
+  }
+
+  virtual ~SendResult() = default;
+
+  inline SendStatus getSendStatus() const { return send_status_; }
+
+  inline const std::string& getMsgId() const { return msg_id_; }
 
-  SendResult(const SendResult& other);
-  SendResult& operator=(const SendResult& other);
+  inline const std::string& getOffsetMsgId() const { return offset_msg_id_; }
 
-  virtual ~SendResult();
+  inline const MQMessageQueue& getMessageQueue() const { return message_queue_; }
 
-  SendStatus getSendStatus() const;
-  const std::string& getMsgId() const;
-  const std::string& getOffsetMsgId() const;
-  const MQMessageQueue& getMessageQueue() const;
-  int64_t getQueueOffset() const;
+  inline int64_t getQueueOffset() const { return queue_offset_; }
 
-  const std::string& getTransactionId() const { return m_transactionId; }
-  void setTransactionId(const std::string& id) { m_transactionId = id; }
+  inline const std::string& getTransactionId() const { return transaction_id_; }
+  inline void setTransactionId(const std::string& id) { transaction_id_ = id; }
 
   std::string toString() const;
 
  private:
-  SendStatus m_sendStatus;
-  std::string m_msgId;
-  std::string m_offsetMsgId;
-  MQMessageQueue m_messageQueue;
-  int64_t m_queueOffset;
-  std::string m_transactionId;
+  SendStatus send_status_;
+  std::string msg_id_;
+  std::string offset_msg_id_;
+  MQMessageQueue message_queue_;
+  int64_t queue_offset_;
+  std::string transaction_id_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __SEND_RESULT_H__
+#endif  // ROCKETMQ_SENDRESULT_H_
diff --git a/include/SessionCredentials.h b/include/SessionCredentials.h
index 15dd25a..2d03f2a 100644
--- a/include/SessionCredentials.h
+++ b/include/SessionCredentials.h
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SESSION_CREDENTIALS_H__
-#define __SESSION_CREDENTIALS_H__
+#ifndef ROCKETMQ_SESSIONCREDENTIALS_H_
+#define ROCKETMQ_SESSIONCREDENTIALS_H_
 
-#include <string>
+#include <string>  // std::string
 
 #include "RocketMQClient.h"
 
@@ -25,49 +25,43 @@ namespace rocketmq {
 
 class ROCKETMQCLIENT_API SessionCredentials {
  public:
-  static const std::string AccessKey;
-  static const std::string SecretKey;
-  static const std::string Signature;
-  static const std::string SignatureMethod;
-  static const std::string ONSChannelKey;
-
-  SessionCredentials() : authChannel_("ALIYUN") {}
+  SessionCredentials() : auth_channel_("ALIYUN") {}
   SessionCredentials(const std::string& accessKey, const std::string& secretKey, const std::string& authChannel)
-      : accessKey_(accessKey), secretKey_(secretKey), authChannel_(authChannel) {}
+      : access_key_(accessKey), secret_key_(secretKey), auth_channel_(authChannel) {}
   SessionCredentials(const SessionCredentials& other)
-      : accessKey_(other.accessKey_),
-        secretKey_(other.secretKey_),
+      : access_key_(other.access_key_),
+        secret_key_(other.secret_key_),
         signature_(other.signature_),
-        signatureMethod_(other.signatureMethod_),
-        authChannel_(other.authChannel_) {}
+        signature_method_(other.signature_method_),
+        auth_channel_(other.auth_channel_) {}
 
   ~SessionCredentials() = default;
 
-  const std::string& getAccessKey() const { return accessKey_; }
-  void setAccessKey(const std::string& accessKey) { accessKey_ = accessKey; }
+  inline const std::string& getAccessKey() const { return access_key_; }
+  inline void setAccessKey(const std::string& accessKey) { access_key_ = accessKey; }
 
-  const std::string& getSecretKey() const { return secretKey_; }
-  void setSecretKey(const std::string& secretKey) { secretKey_ = secretKey; }
+  inline const std::string& getSecretKey() const { return secret_key_; }
+  inline void setSecretKey(const std::string& secretKey) { secret_key_ = secretKey; }
 
-  const std::string& getSignature() const { return signature_; }
-  void setSignature(const std::string& signature) { signature_ = signature; }
+  inline const std::string& getSignature() const { return signature_; }
+  inline void setSignature(const std::string& signature) { signature_ = signature; }
 
-  const std::string& getSignatureMethod() const { return signatureMethod_; }
-  void setSignatureMethod(const std::string& signatureMethod) { signatureMethod_ = signatureMethod; }
+  inline const std::string& getSignatureMethod() const { return signature_method_; }
+  inline void setSignatureMethod(const std::string& signatureMethod) { signature_method_ = signatureMethod; }
 
-  const std::string& getAuthChannel() const { return authChannel_; }
-  void setAuthChannel(const std::string& channel) { authChannel_ = channel; }
+  inline const std::string& getAuthChannel() const { return auth_channel_; }
+  inline void setAuthChannel(const std::string& channel) { auth_channel_ = channel; }
 
-  bool isValid() const { return !accessKey_.empty() && !secretKey_.empty() && !authChannel_.empty(); }
+  bool isValid() const { return !access_key_.empty() && !secret_key_.empty() && !auth_channel_.empty(); }
 
  private:
-  std::string accessKey_;
-  std::string secretKey_;
+  std::string access_key_;
+  std::string secret_key_;
   std::string signature_;
-  std::string signatureMethod_;
-  std::string authChannel_;
+  std::string signature_method_;
+  std::string auth_channel_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __SESSION_CREDENTIALS_H__
+#endif  // ROCKETMQ_SESSIONCREDENTIALS_H_
diff --git a/include/TransactionListener.h b/include/TransactionListener.h
index 3af087c..cc4d537 100644
--- a/include/TransactionListener.h
+++ b/include/TransactionListener.h
@@ -14,14 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __TRANSACTION_LISTENER_H__
-#define __TRANSACTION_LISTENER_H__
+#ifndef ROCKETMQ_TRANSACTIONLISTENER_H_
+#define ROCKETMQ_TRANSACTIONLISTENER_H_
 
 #include "MQMessageExt.h"
 #include "TransactionSendResult.h"
 
 namespace rocketmq {
 
+/**
+ * TransactionListener - listener interface for TransactionMQProducer
+ */
 class ROCKETMQCLIENT_API TransactionListener {
  public:
   virtual ~TransactionListener() = default;
@@ -47,4 +50,4 @@ class ROCKETMQCLIENT_API TransactionListener {
 
 }  // namespace rocketmq
 
-#endif  // __TRANSACTION_LISTENER_H__
+#endif  // ROCKETMQ_TRANSACTIONLISTENER_H_
diff --git a/include/TransactionMQProducer.h b/include/TransactionMQProducer.h
index 4efe26d..3e2222a 100644
--- a/include/TransactionMQProducer.h
+++ b/include/TransactionMQProducer.h
@@ -14,32 +14,39 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __TRANSACTION_MQ_PRODUCER_H__
-#define __TRANSACTION_MQ_PRODUCER_H__
+#ifndef ROCKETMQ_TRANSACTIONMQPRODUCER_H_
+#define ROCKETMQ_TRANSACTIONMQPRODUCER_H_
 
 #include "DefaultMQProducer.h"
 #include "TransactionMQProducerConfig.h"
 
 namespace rocketmq {
 
-class ROCKETMQCLIENT_API TransactionMQProducer : public DefaultMQProducer, virtual public TransactionMQProducerConfig {
+class ROCKETMQCLIENT_API TransactionMQProducer : public DefaultMQProducer,                   // base
+                                                 virtual public TransactionMQProducerConfig  // interface
+{
  public:
   TransactionMQProducer(const std::string& groupname);
   TransactionMQProducer(const std::string& groupname, RPCHookPtr rpcHook);
   virtual ~TransactionMQProducer();
 
- public:  // TransactionMQProducerConfig
-  TransactionListener* getTransactionListener() const override;
-  void setTransactionListener(TransactionListener* transactionListener) override;
-
  public:  // MQProducer
   void start() override;
   void shutdown() override;
 
-  // Transaction: don't delete msg object, until callback occur.
+  // Transaction
   TransactionSendResult sendMessageInTransaction(MQMessage& msg, void* arg) override;
+
+ public:  // TransactionMQProducerConfig
+  TransactionListener* getTransactionListener() const override;
+  void setTransactionListener(TransactionListener* transactionListener) override;
+
+ public:  // DefaultMQProducerConfigProxy
+  inline TransactionMQProducerConfigPtr real_config() const {
+    return std::dynamic_pointer_cast<TransactionMQProducer>(client_config_);
+  }
 };
 
 }  // namespace rocketmq
 
-#endif  // __TRANSACTION_MQ_PRODUCER_H__
+#endif  // ROCKETMQ_TRANSACTIONMQPRODUCER_H_
diff --git a/include/TransactionMQProducerConfig.h b/include/TransactionMQProducerConfig.h
index e341aa2..fab3f07 100644
--- a/include/TransactionMQProducerConfig.h
+++ b/include/TransactionMQProducerConfig.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __TRANSACTION_MQ_PRODUCER_CONFIG_H__
-#define __TRANSACTION_MQ_PRODUCER_CONFIG_H__
+#ifndef ROCKETMQ_TRANSACTIONMQPRODUCERCONFIG_H_
+#define ROCKETMQ_TRANSACTIONMQPRODUCERCONFIG_H_
 
 #include "DefaultMQProducerConfig.h"
 #include "TransactionListener.h"
@@ -25,6 +25,9 @@ namespace rocketmq {
 class TransactionMQProducerConfig;
 typedef std::shared_ptr<TransactionMQProducerConfig> TransactionMQProducerConfigPtr;
 
+/**
+ * TransactionMQProducerConfig - config interface for TransactionMQProducer
+ */
 class ROCKETMQCLIENT_API TransactionMQProducerConfig : virtual public DefaultMQProducerConfig {
  public:
   virtual ~TransactionMQProducerConfig() = default;
@@ -36,4 +39,4 @@ class ROCKETMQCLIENT_API TransactionMQProducerConfig : virtual public DefaultMQP
 
 }  // namespace rocketmq
 
-#endif  // __TRANSACTION_MQ_PRODUCER_CONFIG_H__
+#endif  // ROCKETMQ_TRANSACTIONMQPRODUCERCONFIG_H_
diff --git a/include/TransactionSendResult.h b/include/TransactionSendResult.h
index 03d626f..7219d16 100644
--- a/include/TransactionSendResult.h
+++ b/include/TransactionSendResult.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __TRANSACTION_SEND_RESULT_H__
-#define __TRANSACTION_SEND_RESULT_H__
+#ifndef ROCKETMQ_TRANSACTIONSENDRESULT_H_
+#define ROCKETMQ_TRANSACTIONSENDRESULT_H_
 
 #include "SendResult.h"
 
@@ -25,18 +25,18 @@ enum LocalTransactionState { COMMIT_MESSAGE, ROLLBACK_MESSAGE, UNKNOWN };
 
 class ROCKETMQCLIENT_API TransactionSendResult : public SendResult {
  public:
-  TransactionSendResult(const SendResult& sendResult) : SendResult(sendResult), m_localTransactionState(UNKNOWN) {}
+  TransactionSendResult(const SendResult& sendResult) : SendResult(sendResult), local_transaction_state_(UNKNOWN) {}
 
-  LocalTransactionState getLocalTransactionState() { return m_localTransactionState; }
+  inline LocalTransactionState getLocalTransactionState() const { return local_transaction_state_; }
 
-  void setLocalTransactionState(LocalTransactionState localTransactionState) {
-    m_localTransactionState = localTransactionState;
+  inline void setLocalTransactionState(LocalTransactionState localTransactionState) {
+    local_transaction_state_ = localTransactionState;
   }
 
  private:
-  LocalTransactionState m_localTransactionState;
+  LocalTransactionState local_transaction_state_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __TRANSACTION_SEND_RESULT_H__
+#endif  // ROCKETMQ_TRANSACTIONSENDRESULT_H_
diff --git a/include/c/CBatchMessage.h b/include/c/CBatchMessage.h
index 1b4da7e..eafa24c 100644
--- a/include/c/CBatchMessage.h
+++ b/include/c/CBatchMessage.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_BATCH_MESSAGE_H__
-#define __C_BATCH_MESSAGE_H__
+#ifndef ROCKETMQ_C_CBATCHMESSAGE_H_
+#define ROCKETMQ_C_CBATCHMESSAGE_H_
 
 #include "CCommon.h"
 #include "CMessage.h"
@@ -34,4 +34,4 @@ ROCKETMQCLIENT_API int DestroyBatchMessage(CBatchMessage* batchMsg);
 }
 #endif
 
-#endif  // __C_BATCH_MESSAGE_H__
+#endif  // ROCKETMQ_C_CBATCHMESSAGE_H_
diff --git a/include/c/CCommon.h b/include/c/CCommon.h
index 167f645..ae7adf0 100644
--- a/include/c/CCommon.h
+++ b/include/c/CCommon.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_COMMON_H__
-#define __C_COMMON_H__
+#ifndef ROCKETMQ_C_CCOMMON_H_
+#define ROCKETMQ_C_CCOMMON_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -84,4 +84,4 @@ typedef enum _CMessageModel_ { BROADCASTING, CLUSTERING } CMessageModel;
 }
 #endif
 
-#endif  // __C_COMMON_H__
+#endif  // ROCKETMQ_C_CCOMMON_H_
diff --git a/include/c/CErrorMessage.h b/include/c/CErrorMessage.h
index 928950c..56e89db 100644
--- a/include/c/CErrorMessage.h
+++ b/include/c/CErrorMessage.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_ERROR_MESSAGE_H__
-#define __C_ERROR_MESSAGE_H__
+#ifndef ROCCKETMQ_C_CERRORMESSAGE_H_
+#define ROCCKETMQ_C_CERRORMESSAGE_H_
 
 #include "CCommon.h"
 
@@ -29,4 +29,4 @@ ROCKETMQCLIENT_API const char* GetLatestErrorMessage();  // Return the last erro
 }
 #endif
 
-#endif  // __C_ERROR_MESSAGE_H__
+#endif  // ROCCKETMQ_C_CERRORMESSAGE_H_
diff --git a/include/c/CMQException.h b/include/c/CMQException.h
index 7e2f498..2fb4a7e 100644
--- a/include/c/CMQException.h
+++ b/include/c/CMQException.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_MQEXCPTION_H__
-#define __C_MQEXCPTION_H__
+#ifndef ROCKETMQ_C_CMQEXCPTION_H_
+#define ROCKETMQ_C_CMQEXCPTION_H_
 
 #include "CCommon.h"
 
@@ -39,4 +39,4 @@ typedef struct _CMQException_ {
 }
 #endif
 
-#endif
+#endif  // ROCKETMQ_C_CMQEXCPTION_H_
diff --git a/include/c/CMessage.h b/include/c/CMessage.h
index 7c16f15..7bbba3a 100644
--- a/include/c/CMessage.h
+++ b/include/c/CMessage.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_MESSAGE_H__
-#define __C_MESSAGE_H__
+#ifndef ROCKETMQ_C_CMESSAGE_H_
+#define ROCKETMQ_C_CMESSAGE_H_
 
 #include "CCommon.h"
 
@@ -23,7 +23,7 @@
 extern "C" {
 #endif
 
-typedef struct CMessage CMessage;
+typedef struct CMessage CMessage;  // alias as MQMessage
 
 ROCKETMQCLIENT_API CMessage* CreateMessage(const char* topic);
 ROCKETMQCLIENT_API int DestroyMessage(CMessage* msg);
@@ -45,4 +45,4 @@ ROCKETMQCLIENT_API int GetOriginDelayTimeLevel(CMessage* msg);
 }
 #endif
 
-#endif  // __C_MESSAGE_H__
+#endif  // ROCKETMQ_C_CMESSAGE_H_
diff --git a/include/c/CMessageExt.h b/include/c/CMessageExt.h
index bfd4343..4b4c7df 100644
--- a/include/c/CMessageExt.h
+++ b/include/c/CMessageExt.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_MESSAGE_EXT_H__
-#define __C_MESSAGE_EXT_H__
+#ifndef ROCKETMQ_C_CMESSAGEEXT_H_
+#define ROCKETMQ_C_CMESSAGEEXT_H_
 
 #include "CCommon.h"
 
@@ -23,7 +23,7 @@
 extern "C" {
 #endif
 
-typedef struct CMessageExt CMessageExt;
+typedef struct CMessageExt CMessageExt;  // alias for MQMessageExt
 
 ROCKETMQCLIENT_API const char* GetMessageTopic(CMessageExt* msgExt);
 ROCKETMQCLIENT_API const char* GetMessageTags(CMessageExt* msgExt);
@@ -45,4 +45,4 @@ ROCKETMQCLIENT_API long long GetMessagePreparedTransactionOffset(CMessageExt* ms
 }
 #endif
 
-#endif  // __C_MESSAGE_EXT_H__
+#endif  // ROCKETMQ_C_CMESSAGEEXT_H_
diff --git a/include/c/CMessageQueue.h b/include/c/CMessageQueue.h
index bd6da37..e83248f 100644
--- a/include/c/CMessageQueue.h
+++ b/include/c/CMessageQueue.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_MESSAGE_QUEUE_H__
-#define __C_MESSAGE_QUEUE_H__
+#ifndef ROCKETMQ_C_CMESSAGEQUEUE_H_
+#define ROCKETMQ_C_CMESSAGEQUEUE_H_
 
 #include "CCommon.h"
 
@@ -33,4 +33,4 @@ typedef struct _CMessageQueue_ {
 }
 #endif
 
-#endif  // __C_MESSAGE_H__
+#endif  // ROCKETMQ_C_CMESSAGEQUEUE_H_
diff --git a/include/c/CProducer.h b/include/c/CProducer.h
index ed8800c..6c797b0 100644
--- a/include/c/CProducer.h
+++ b/include/c/CProducer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_PRODUCER_H__
-#define __C_PRODUCER_H__
+#ifndef ROCKETMQ_C_CPRODUCER_H_
+#define ROCKETMQ_C_CPRODUCER_H_
 
 #include "CBatchMessage.h"
 #include "CMQException.h"
@@ -28,7 +28,8 @@
 extern "C" {
 #endif
 
-typedef struct CProducer CProducer;
+typedef struct CProducer CProducer;  // alias for DefaultMQProducer
+
 typedef int (*QueueSelectorCallback)(int size, CMessage* msg, void* arg);
 typedef void (*CSendSuccessCallback)(CSendResult result);
 typedef void (*CSendExceptionCallback)(CMQException e);
@@ -105,4 +106,4 @@ ROCKETMQCLIENT_API int SendMessageTransaction(CProducer* producer,
 }
 #endif
 
-#endif  // __C_PRODUCER_H__
+#endif  // ROCKETMQ_C_CPRODUCER_H_
diff --git a/include/c/CPullConsumer.h b/include/c/CPullConsumer.h
index 41ebbb9..852e17f 100644
--- a/include/c/CPullConsumer.h
+++ b/include/c/CPullConsumer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_PULL_CONSUMER_H__
-#define __C_PULL_CONSUMER_H__
+#ifndef ROCKETMQ_C_CPULLCONSUMER_H_
+#define ROCKETMQ_C_CPULLCONSUMER_H_
 
 #include "CCommon.h"
 #include "CMessageExt.h"
@@ -58,4 +58,4 @@ ROCKETMQCLIENT_API int ReleasePullResult(CPullResult pullResult);
 }
 #endif
 
-#endif  // __C_PUSH_CONSUMER_H__
+#endif  // ROCKETMQ_C_CPULLCONSUMER_H_
diff --git a/include/c/CPullResult.h b/include/c/CPullResult.h
index 2f58030..6fc45e9 100644
--- a/include/c/CPullResult.h
+++ b/include/c/CPullResult.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_PULL_RESULT_H__
-#define __C_PULL_RESULT_H__
+#ifndef ROCCKETMQ_C_CPULLRESULT_H_
+#define ROCCKETMQ_C_CPULLRESULT_H_
 
 #include "CCommon.h"
 #include "CMessageExt.h"
@@ -46,4 +46,4 @@ typedef struct _CPullResult_ {
 }
 #endif
 
-#endif  // __C_PULL_RESULT_H__
+#endif  // ROCCKETMQ_C_CPULLRESULT_H_
diff --git a/include/c/CPushConsumer.h b/include/c/CPushConsumer.h
index 4a8bd14..8b7987e 100644
--- a/include/c/CPushConsumer.h
+++ b/include/c/CPushConsumer.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_PUSH_CONSUMER_H__
-#define __C_PUSH_CONSUMER_H__
+#ifndef ROCKETMQ_C_CPUSHCONSUMER_H_
+#define ROCKETMQ_C_CPUSHCONSUMER_H_
 
 #include "CCommon.h"
 #include "CMessageExt.h"
@@ -24,7 +24,7 @@
 extern "C" {
 #endif
 
-typedef struct CPushConsumer CPushConsumer;
+typedef struct CPushConsumer CPushConsumer;  // alias for DefaultMQPushConssumer
 
 typedef enum E_CConsumeStatus { E_CONSUME_SUCCESS = 0, E_RECONSUME_LATER = 1 } CConsumeStatus;
 
@@ -61,4 +61,4 @@ ROCKETMQCLIENT_API int SetPushConsumerMaxCacheMessageSizeInMb(CPushConsumer* con
 }
 #endif
 
-#endif  // __C_PUSH_CONSUMER_H__
+#endif  // ROCKETMQ_C_CPUSHCONSUMER_H_
diff --git a/include/c/CSendResult.h b/include/c/CSendResult.h
index 3ac2fcd..bf22e6a 100644
--- a/include/c/CSendResult.h
+++ b/include/c/CSendResult.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_SEND_RESULT_H__
-#define __C_SEND_RESULT_H__
+#ifndef ROCKETMQ_C_CSENDRESULT_H_
+#define ROCKETMQ_C_CSENDRESULT_H_
 
 #include "CCommon.h"
 
@@ -40,4 +40,4 @@ typedef struct _SendResult_ {
 }
 #endif
 
-#endif  // __C_PRODUCER_H__
+#endif  // ROCKETMQ_C_CSENDRESULT_H_
diff --git a/include/c/CTransactionStatus.h b/include/c/CTransactionStatus.h
index f0bff3c..a46b827 100644
--- a/include/c/CTransactionStatus.h
+++ b/include/c/CTransactionStatus.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __C_TRANSACTION_STATUS_H__
-#define __C_TRANSACTION_STATUS_H__
+#ifndef ROCKETMQ_C_CTRANSACTIONSTATUS_H_
+#define ROCKETMQ_C_CTRANSACTIONSTATUS_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -31,4 +31,4 @@ typedef enum E_CTransactionStatus {
 }
 #endif
 
-#endif  // __C_TRANSACTION_STATUS_H__
+#endif  // ROCKETMQ_C_CTRANSACTIONSTATUS_H_
diff --git a/src/ClientRemotingProcessor.cpp b/src/ClientRemotingProcessor.cpp
index 6361628..aa742ba 100644
--- a/src/ClientRemotingProcessor.cpp
+++ b/src/ClientRemotingProcessor.cpp
@@ -19,7 +19,7 @@
 #include "ConsumerRunningInfo.h"
 #include "MessageDecoder.h"
 #include "MQProtos.h"
-#include "MessageAccessor.h"
+#include "MessageAccessor.hpp"
 #include "MessageSysFlag.h"
 #include "RequestFutureTable.h"
 #include "SocketUtil.h"
@@ -29,7 +29,7 @@
 
 namespace rocketmq {
 
-ClientRemotingProcessor::ClientRemotingProcessor(MQClientInstance* clientInstance) : m_clientInstance(clientInstance) {}
+ClientRemotingProcessor::ClientRemotingProcessor(MQClientInstance* clientInstance) : client_instance_(clientInstance) {}
 
 ClientRemotingProcessor::~ClientRemotingProcessor() = default;
 
@@ -74,7 +74,7 @@ RemotingCommand* ClientRemotingProcessor::checkTransactionState(const std::strin
       }
       const auto& group = messageExt->getProperty(MQMessageConst::PROPERTY_PRODUCER_GROUP);
       if (!group.empty()) {
-        auto* producer = m_clientInstance->selectProducer(group);
+        auto* producer = client_instance_->selectProducer(group);
         if (producer != nullptr) {
           producer->checkTransactionState(addr, messageExt, requestHeader);
         } else {
@@ -96,7 +96,7 @@ RemotingCommand* ClientRemotingProcessor::checkTransactionState(const std::strin
 RemotingCommand* ClientRemotingProcessor::notifyConsumerIdsChanged(RemotingCommand* request) {
   auto* requestHeader = request->decodeCommandCustomHeader<NotifyConsumerIdsChangedRequestHeader>();
   LOG_INFO_NEW("notifyConsumerIdsChanged, group:{}", requestHeader->getConsumerGroup());
-  m_clientInstance->rebalanceImmediately();
+  client_instance_->rebalanceImmediately();
   return nullptr;
 }
 
@@ -106,7 +106,7 @@ RemotingCommand* ClientRemotingProcessor::resetOffset(RemotingCommand* request)
   if (requestBody != nullptr && requestBody->size() > 0) {
     std::unique_ptr<ResetOffsetBody> body(ResetOffsetBody::Decode(*requestBody));
     if (body != nullptr) {
-      m_clientInstance->resetOffset(responseHeader->getGroup(), responseHeader->getTopic(), body->getOffsetTable());
+      client_instance_->resetOffset(responseHeader->getGroup(), responseHeader->getTopic(), body->getOffsetTable());
     } else {
       LOG_ERROR("resetOffset failed as received data could not be unserialized");
     }
@@ -122,7 +122,7 @@ RemotingCommand* ClientRemotingProcessor::getConsumerRunningInfo(const std::stri
       new RemotingCommand(MQResponseCode::SYSTEM_ERROR, "not set any response code"));
 
   std::unique_ptr<ConsumerRunningInfo> runningInfo(
-      m_clientInstance->consumerRunningInfo(requestHeader->getConsumerGroup()));
+      client_instance_->consumerRunningInfo(requestHeader->getConsumerGroup()));
   if (runningInfo != nullptr) {
     if (requestHeader->isJstackEnable()) {
       /*string jstack = UtilAll::jstack();
diff --git a/src/ClientRemotingProcessor.h b/src/ClientRemotingProcessor.h
index e758cbc..ca28297 100644
--- a/src/ClientRemotingProcessor.h
+++ b/src/ClientRemotingProcessor.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __CLIENT_REMOTING_PROCESSOR_H__
-#define __CLIENT_REMOTING_PROCESSOR_H__
+#ifndef ROCKETMQ_CLIENTREMOTINGPROCESSOR_H_
+#define ROCKETMQ_CLIENTREMOTINGPROCESSOR_H_
 
 #include "MQClientInstance.h"
 #include "MQMessageQueue.h"
@@ -40,9 +40,9 @@ class ClientRemotingProcessor : public RequestProcessor {
   void processReplyMessage(std::unique_ptr<MQMessageExt> replyMsg);
 
  private:
-  MQClientInstance* m_clientInstance;
+  MQClientInstance* client_instance_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __CLIENT_REMOTING_PROCESSOR_H__
+#endif  // ROCKETMQ_CLIENTREMOTINGPROCESSOR_H_
diff --git a/src/MQAdminImpl.cpp b/src/MQAdminImpl.cpp
index 5f334a2..217c517 100644
--- a/src/MQAdminImpl.cpp
+++ b/src/MQAdminImpl.cpp
@@ -18,7 +18,7 @@
 
 #include "MQClientAPIImpl.h"
 #include "MQClientInstance.h"
-#include "TopicPublishInfo.h"
+#include "TopicPublishInfo.hpp"
 
 namespace rocketmq {
 
@@ -27,9 +27,9 @@ void MQAdminImpl::createTopic(const std::string& key, const std::string& newTopi
 void MQAdminImpl::fetchSubscribeMessageQueues(const std::string& topic, std::vector<MQMessageQueue>& mqs) {
   try {
     TopicRouteDataPtr topicRouteData(
-        m_clientInstance->getMQClientAPIImpl()->getTopicRouteInfoFromNameServer(topic, 1000 * 3));
+        client_instance_->getMQClientAPIImpl()->getTopicRouteInfoFromNameServer(topic, 1000 * 3));
     if (topicRouteData != nullptr) {
-      mqs = m_clientInstance->topicRouteData2TopicSubscribeInfo(topic, topicRouteData);
+      mqs = client_instance_->topicRouteData2TopicSubscribeInfo(topic, topicRouteData);
       if (!mqs.empty()) {
         return;
       } else {
@@ -45,15 +45,15 @@ void MQAdminImpl::fetchSubscribeMessageQueues(const std::string& topic, std::vec
 }
 
 int64_t MQAdminImpl::searchOffset(const MQMessageQueue& mq, int64_t timestamp) {
-  std::string brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+  std::string brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   if (brokerAddr.empty()) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
-    brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+    client_instance_->updateTopicRouteInfoFromNameServer(mq.topic());
+    brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   }
 
   if (!brokerAddr.empty()) {
     try {
-      return m_clientInstance->getMQClientAPIImpl()->searchOffset(brokerAddr, mq.getTopic(), mq.getQueueId(), timestamp,
+      return client_instance_->getMQClientAPIImpl()->searchOffset(brokerAddr, mq.topic(), mq.queue_id(), timestamp,
                                                                   1000 * 3);
     } catch (MQException& e) {
       THROW_MQEXCEPTION(MQClientException, "Invoke Broker exception", -1);
@@ -63,15 +63,15 @@ int64_t MQAdminImpl::searchOffset(const MQMessageQueue& mq, int64_t timestamp) {
 }
 
 int64_t MQAdminImpl::maxOffset(const MQMessageQueue& mq) {
-  std::string brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+  std::string brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   if (brokerAddr.empty()) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
-    brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+    client_instance_->updateTopicRouteInfoFromNameServer(mq.topic());
+    brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   }
 
   if (!brokerAddr.empty()) {
     try {
-      return m_clientInstance->getMQClientAPIImpl()->getMaxOffset(brokerAddr, mq.getTopic(), mq.getQueueId(), 1000 * 3);
+      return client_instance_->getMQClientAPIImpl()->getMaxOffset(brokerAddr, mq.topic(), mq.queue_id(), 1000 * 3);
     } catch (MQException& e) {
       THROW_MQEXCEPTION(MQClientException, "Invoke Broker exception", -1);
     }
@@ -80,33 +80,33 @@ int64_t MQAdminImpl::maxOffset(const MQMessageQueue& mq) {
 }
 
 int64_t MQAdminImpl::minOffset(const MQMessageQueue& mq) {
-  std::string brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+  std::string brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   if (brokerAddr.empty()) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
-    brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+    client_instance_->updateTopicRouteInfoFromNameServer(mq.topic());
+    brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   }
 
   if (!brokerAddr.empty()) {
     try {
-      return m_clientInstance->getMQClientAPIImpl()->getMinOffset(brokerAddr, mq.getTopic(), mq.getQueueId(), 1000 * 3);
+      return client_instance_->getMQClientAPIImpl()->getMinOffset(brokerAddr, mq.topic(), mq.queue_id(), 1000 * 3);
     } catch (const std::exception& e) {
       THROW_MQEXCEPTION(MQClientException, "Invoke Broker[" + brokerAddr + "] exception", -1);
     }
   }
 
-  THROW_MQEXCEPTION(MQClientException, "The broker[" + mq.getBrokerName() + "] not exist", -1);
+  THROW_MQEXCEPTION(MQClientException, "The broker[" + mq.broker_name() + "] not exist", -1);
 }
 
 int64_t MQAdminImpl::earliestMsgStoreTime(const MQMessageQueue& mq) {
-  std::string brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+  std::string brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   if (brokerAddr.empty()) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
-    brokerAddr = m_clientInstance->findBrokerAddressInPublish(mq.getBrokerName());
+    client_instance_->updateTopicRouteInfoFromNameServer(mq.topic());
+    brokerAddr = client_instance_->findBrokerAddressInPublish(mq.broker_name());
   }
 
   if (!brokerAddr.empty()) {
     try {
-      return m_clientInstance->getMQClientAPIImpl()->getEarliestMsgStoretime(brokerAddr, mq.getTopic(), mq.getQueueId(),
+      return client_instance_->getMQClientAPIImpl()->getEarliestMsgStoretime(brokerAddr, mq.topic(), mq.queue_id(),
                                                                              1000 * 3);
     } catch (MQException& e) {
       THROW_MQEXCEPTION(MQClientException, "Invoke Broker exception", -1);
diff --git a/src/MQAdminImpl.h b/src/MQAdminImpl.h
index 27949c7..c85c989 100644
--- a/src/MQAdminImpl.h
+++ b/src/MQAdminImpl.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_ADMIN_IMPL_H___
-#define __MQ_ADMIN_IMPL_H___
+#ifndef ROCKETMQ_MQADMINIMPL_H_
+#define ROCKETMQ_MQADMINIMPL_H_
 
 #include <string>
 #include <vector>
@@ -29,7 +29,7 @@ namespace rocketmq {
 
 class MQAdminImpl {
  public:
-  MQAdminImpl(MQClientInstance* clientInstance) : m_clientInstance(clientInstance) {}
+  MQAdminImpl(MQClientInstance* clientInstance) : client_instance_(clientInstance) {}
 
   void createTopic(const std::string& key, const std::string& newTopic, int queueNum);
 
@@ -44,9 +44,9 @@ class MQAdminImpl {
   QueryResult queryMessage(const std::string& topic, const std::string& key, int maxNum, int64_t begin, int64_t end);
 
  private:
-  MQClientInstance* m_clientInstance;
+  MQClientInstance* client_instance_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_ADMIN_IMPL_H___
+#endif  // ROCKETMQ_MQADMINIMPL_H_
diff --git a/src/MQClientAPIImpl.cpp b/src/MQClientAPIImpl.cpp
index 42c9f6f..429ff17 100644
--- a/src/MQClientAPIImpl.cpp
+++ b/src/MQClientAPIImpl.cpp
@@ -25,7 +25,7 @@
 #include "MessageBatch.h"
 #include "MessageClientIDSetter.h"
 #include "PullCallbackWrap.h"
-#include "PullResultExt.h"
+#include "PullResultExt.hpp"
 #include "SendCallbackWrap.h"
 #include "TcpRemotingClient.h"
 
@@ -34,45 +34,46 @@ namespace rocketmq {
 MQClientAPIImpl::MQClientAPIImpl(ClientRemotingProcessor* clientRemotingProcessor,
                                  RPCHookPtr rpcHook,
                                  const MQClientConfig& clientConfig)
-    : m_remotingClient(new TcpRemotingClient(clientConfig.getTcpTransportWorkerThreadNum(),
+    : remoting_client_(new TcpRemotingClient(clientConfig.getTcpTransportWorkerThreadNum(),
                                              clientConfig.getTcpTransportConnectTimeout(),
                                              clientConfig.getTcpTransportTryLockTimeout())) {
-  m_remotingClient->registerRPCHook(rpcHook);
-  m_remotingClient->registerProcessor(CHECK_TRANSACTION_STATE, clientRemotingProcessor);
-  m_remotingClient->registerProcessor(NOTIFY_CONSUMER_IDS_CHANGED, clientRemotingProcessor);
-  m_remotingClient->registerProcessor(RESET_CONSUMER_CLIENT_OFFSET, clientRemotingProcessor);
-  m_remotingClient->registerProcessor(GET_CONSUMER_STATUS_FROM_CLIENT, clientRemotingProcessor);
-  m_remotingClient->registerProcessor(GET_CONSUMER_RUNNING_INFO, clientRemotingProcessor);
-  m_remotingClient->registerProcessor(CONSUME_MESSAGE_DIRECTLY, clientRemotingProcessor);
-  m_remotingClient->registerProcessor(PUSH_REPLY_MESSAGE_TO_CLIENT, clientRemotingProcessor);
+  remoting_client_->registerRPCHook(rpcHook);
+  remoting_client_->registerProcessor(CHECK_TRANSACTION_STATE, clientRemotingProcessor);
+  remoting_client_->registerProcessor(NOTIFY_CONSUMER_IDS_CHANGED, clientRemotingProcessor);
+  remoting_client_->registerProcessor(RESET_CONSUMER_CLIENT_OFFSET, clientRemotingProcessor);
+  remoting_client_->registerProcessor(GET_CONSUMER_STATUS_FROM_CLIENT, clientRemotingProcessor);
+  remoting_client_->registerProcessor(GET_CONSUMER_RUNNING_INFO, clientRemotingProcessor);
+  remoting_client_->registerProcessor(CONSUME_MESSAGE_DIRECTLY, clientRemotingProcessor);
+  remoting_client_->registerProcessor(PUSH_REPLY_MESSAGE_TO_CLIENT, clientRemotingProcessor);
 }
 
 MQClientAPIImpl::~MQClientAPIImpl() = default;
 
 void MQClientAPIImpl::start() {
-  m_remotingClient->start();
+  remoting_client_->start();
 }
 
 void MQClientAPIImpl::shutdown() {
-  m_remotingClient->shutdown();
+  remoting_client_->shutdown();
 }
 
-void MQClientAPIImpl::updateNameServerAddr(const std::string& addrs) {
-  m_remotingClient->updateNameServerAddressList(addrs);
+void MQClientAPIImpl::updateNameServerAddressList(const std::string& addrs) {
+  // TODO: split addrs
+  remoting_client_->updateNameServerAddressList(addrs);
 }
 
 void MQClientAPIImpl::createTopic(const std::string& addr, const std::string& defaultTopic, TopicConfig topicConfig) {
   auto* requestHeader = new CreateTopicRequestHeader();
-  requestHeader->topic = topicConfig.getTopicName();
+  requestHeader->topic = topicConfig.topic_name();
   requestHeader->defaultTopic = defaultTopic;
-  requestHeader->readQueueNums = topicConfig.getReadQueueNums();
-  requestHeader->writeQueueNums = topicConfig.getWriteQueueNums();
-  requestHeader->perm = topicConfig.getPerm();
-  requestHeader->topicFilterType = topicConfig.getTopicFilterType();
+  requestHeader->readQueueNums = topicConfig.read_queue_nums();
+  requestHeader->writeQueueNums = topicConfig.write_queue_nums();
+  requestHeader->perm = topicConfig.perm();
+  requestHeader->topicFilterType = topicConfig.topic_filter_type();
 
   RemotingCommand request(UPDATE_AND_CREATE_TOPIC, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -131,7 +132,7 @@ SendResult* MQClientAPIImpl::sendMessage(const std::string& addr,
 
   switch (communicationMode) {
     case CommunicationMode::ONEWAY:
-      m_remotingClient->invokeOneway(addr, request);
+      remoting_client_->invokeOneway(addr, request);
       return nullptr;
     case CommunicationMode::ASYNC:
       sendMessageAsync(addr, brokerName, msg, std::move(request), sendCallback, topicPublishInfo, instance,
@@ -172,7 +173,7 @@ void MQClientAPIImpl::sendMessageAsync(const std::string& addr,
 void MQClientAPIImpl::sendMessageAsyncImpl(SendCallbackWrap* cbw, int64_t timeoutMillis) {
   const auto& addr = cbw->getAddr();
   auto& request = cbw->getRemotingCommand();
-  m_remotingClient->invokeAsync(addr, request, cbw, timeoutMillis);
+  remoting_client_->invokeAsync(addr, request, cbw, timeoutMillis);
 }
 
 SendResult* MQClientAPIImpl::sendMessageSync(const std::string& addr,
@@ -181,7 +182,7 @@ SendResult* MQClientAPIImpl::sendMessageSync(const std::string& addr,
                                              RemotingCommand& request,
                                              int timeoutMillis) {
   // block until response
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   return processSendResponse(brokerName, msg, response.get());
 }
@@ -217,7 +218,7 @@ SendResult* MQClientAPIImpl::processSendResponse(const std::string& brokerName,
 
   // MessageBatch
   if (msg->isBatch()) {
-    const auto& messages = std::dynamic_pointer_cast<MessageBatch>(msg)->getMessages();
+    const auto& messages = dynamic_cast<MessageBatch*>(msg.get())->messages();
     uniqMsgId.clear();
     uniqMsgId.reserve(33 * messages.size() + 1);
     for (const auto& message : messages) {
@@ -263,7 +264,7 @@ void MQClientAPIImpl::pullMessageAsync(const std::string& addr,
   auto* cbw = new PullCallbackWrap(pullCallback, this);
 
   try {
-    m_remotingClient->invokeAsync(addr, request, cbw, timeoutMillis);
+    remoting_client_->invokeAsync(addr, request, cbw, timeoutMillis);
   } catch (RemotingException& e) {
     deleteAndZero(cbw);
     throw e;
@@ -271,7 +272,7 @@ void MQClientAPIImpl::pullMessageAsync(const std::string& addr,
 }
 
 PullResult* MQClientAPIImpl::pullMessageSync(const std::string& addr, RemotingCommand& request, int timeoutMillis) {
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   return processPullResponse(response.get());
 }
@@ -313,7 +314,7 @@ MQMessageExt MQClientAPIImpl::viewMessage(const std::string& addr, int64_t phyof
 
   RemotingCommand request(VIEW_MESSAGE_BY_ID, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -338,7 +339,7 @@ int64_t MQClientAPIImpl::searchOffset(const std::string& addr,
 
   RemotingCommand request(SEARCH_OFFSET_BY_TIMESTAMP, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -363,7 +364,7 @@ int64_t MQClientAPIImpl::getMaxOffset(const std::string& addr,
 
   RemotingCommand request(GET_MAX_OFFSET, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -387,7 +388,7 @@ int64_t MQClientAPIImpl::getMinOffset(const std::string& addr,
 
   RemotingCommand request(GET_MIN_OFFSET, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -412,7 +413,7 @@ int64_t MQClientAPIImpl::getEarliestMsgStoretime(const std::string& addr,
 
   RemotingCommand request(GET_EARLIEST_MSG_STORETIME, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -436,7 +437,7 @@ void MQClientAPIImpl::getConsumerIdListByGroup(const std::string& addr,
 
   RemotingCommand request(GET_CONSUMER_LIST_BY_GROUP, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -462,7 +463,7 @@ int64_t MQClientAPIImpl::queryConsumerOffset(const std::string& addr,
                                              int timeoutMillis) {
   RemotingCommand request(QUERY_CONSUMER_OFFSET, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -482,7 +483,7 @@ void MQClientAPIImpl::updateConsumerOffset(const std::string& addr,
                                            int timeoutMillis) {
   RemotingCommand request(UPDATE_CONSUMER_OFFSET, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -500,14 +501,14 @@ void MQClientAPIImpl::updateConsumerOffsetOneway(const std::string& addr,
                                                  int timeoutMillis) {
   RemotingCommand request(UPDATE_CONSUMER_OFFSET, requestHeader);
 
-  m_remotingClient->invokeOneway(addr, request);
+  remoting_client_->invokeOneway(addr, request);
 }
 
 void MQClientAPIImpl::sendHearbeat(const std::string& addr, HeartbeatData* heartbeatData, long timeoutMillis) {
   RemotingCommand request(HEART_BEAT, nullptr);
   request.set_body(heartbeatData->encode());
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -528,7 +529,7 @@ void MQClientAPIImpl::unregisterClient(const std::string& addr,
   LOG_INFO("unregisterClient to broker:%s", addr.c_str());
   RemotingCommand request(UNREGISTER_CLIENT, new UnregisterClientRequestHeader(clientID, producerGroup, consumerGroup));
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS:
@@ -548,7 +549,7 @@ void MQClientAPIImpl::endTransactionOneway(const std::string& addr,
   RemotingCommand request(END_TRANSACTION, requestHeader);
   request.set_remark(remark);
 
-  m_remotingClient->invokeOneway(addr, request);
+  remoting_client_->invokeOneway(addr, request);
 }
 
 void MQClientAPIImpl::consumerSendMessageBack(const std::string& addr,
@@ -567,7 +568,7 @@ void MQClientAPIImpl::consumerSendMessageBack(const std::string& addr,
 
   RemotingCommand request(CONSUMER_SEND_MSG_BACK, requestHeader);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -587,7 +588,7 @@ void MQClientAPIImpl::lockBatchMQ(const std::string& addr,
   RemotingCommand request(LOCK_BATCH_MQ, nullptr);
   request.set_body(requestBody->encode());
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -615,9 +616,9 @@ void MQClientAPIImpl::unlockBatchMQ(const std::string& addr,
   request.set_body(requestBody->encode());
 
   if (oneway) {
-    m_remotingClient->invokeOneway(addr, request);
+    remoting_client_->invokeOneway(addr, request);
   } else {
-    std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(addr, request, timeoutMillis));
+    std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(addr, request, timeoutMillis));
     assert(response != nullptr);
     switch (response->code()) {
       case SUCCESS: {
@@ -634,7 +635,7 @@ void MQClientAPIImpl::unlockBatchMQ(const std::string& addr,
 TopicRouteData* MQClientAPIImpl::getTopicRouteInfoFromNameServer(const std::string& topic, int timeoutMillis) {
   RemotingCommand request(GET_ROUTEINTO_BY_TOPIC, new GetRouteInfoRequestHeader(topic));
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(null, request, timeoutMillis));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(null, request, timeoutMillis));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
@@ -654,7 +655,7 @@ TopicRouteData* MQClientAPIImpl::getTopicRouteInfoFromNameServer(const std::stri
 TopicList* MQClientAPIImpl::getTopicListFromNameServer() {
   RemotingCommand request(GET_ALL_TOPIC_LIST_FROM_NAMESERVER, nullptr);
 
-  std::unique_ptr<RemotingCommand> response(m_remotingClient->invokeSync(null, request));
+  std::unique_ptr<RemotingCommand> response(remoting_client_->invokeSync(null, request));
   assert(response != nullptr);
   switch (response->code()) {
     case SUCCESS: {
diff --git a/src/MQClientAPIImpl.h b/src/MQClientAPIImpl.h
index c773991..c947692 100644
--- a/src/MQClientAPIImpl.h
+++ b/src/MQClientAPIImpl.h
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_API_IMPL_H__
-#define __MQ_CLIENT_API_IMPL_H__
+#ifndef ROCKETMQ_MQCLIENTAPIIMPL_H_
+#define ROCKETMQ_MQCLIENTAPIIMPL_H_
 
 #include "CommunicationMode.h"
 #include "DefaultMQProducerImpl.h"
 #include "HeartbeatData.h"
 #include "KVTable.h"
-#include "MQClientException.h"
+#include "MQException.h"
 #include "MQClientInstance.h"
 #include "MQMessageExt.h"
 #include "PullCallback.h"
@@ -29,8 +29,8 @@
 #include "SendResult.h"
 #include "TopicConfig.h"
 #include "TopicList.h"
-#include "TopicPublishInfo.h"
-#include "TopicRouteData.h"
+#include "TopicPublishInfo.hpp"
+#include "TopicRouteData.hpp"
 #include "protocol/body/LockBatchBody.h"
 #include "protocol/header/CommandHeader.h"
 
@@ -54,7 +54,7 @@ class MQClientAPIImpl {
   void start();
   void shutdown();
 
-  void updateNameServerAddr(const std::string& addrs);
+  void updateNameServerAddressList(const std::string& addrs);
 
   void createTopic(const std::string& addr, const std::string& defaultTopic, TopicConfig topicConfig);
 
@@ -159,7 +159,7 @@ class MQClientAPIImpl {
   KVTable getKVListByNamespace(const std::string& projectNamespace, int timeoutMillis);
 
  public:
-  TcpRemotingClient* getRemotingClient() { return m_remotingClient.get(); }
+  TcpRemotingClient* getRemotingClient() { return remoting_client_.get(); }
 
  private:
   friend class SendCallbackWrap;
@@ -191,9 +191,9 @@ class MQClientAPIImpl {
                         PullCallback* pullCallback);
 
  private:
-  std::unique_ptr<TcpRemotingClient> m_remotingClient;
+  std::unique_ptr<TcpRemotingClient> remoting_client_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_API_IMPL_H__
+#endif  // ROCKETMQ_MQCLIENTAPIIMPL_H_
diff --git a/src/MQClientConfigImpl.cpp b/src/MQClientConfigImpl.cpp
deleted file mode 100644
index b8a24f8..0000000
--- a/src/MQClientConfigImpl.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "MQClientConfigImpl.h"
-
-#include <algorithm>
-#include <thread>
-
-#include "NameSpaceUtil.h"
-#include "UtilAll.h"
-
-namespace rocketmq {
-
-static const std::string DEFAULT_INSTANCE_NAME = "DEFAULT";
-
-MQClientConfigImpl::MQClientConfigImpl()
-    : m_instanceName(DEFAULT_INSTANCE_NAME),
-      m_tcpWorkerThreadNum(std::min(4, (int)std::thread::hardware_concurrency())),
-      m_tcpConnectTimeout(3000),
-      m_tcpTransportTryLockTimeout(3) {
-  const char* addr = std::getenv(ROCKETMQ_NAMESRV_ADDR_ENV.c_str());
-  if (addr != nullptr) {
-    m_namesrvAddr = addr;
-  }
-}
-
-std::string MQClientConfigImpl::buildMQClientId() const {
-  std::string clientId;
-  clientId.append(UtilAll::getLocalAddress());  // clientIP
-  clientId.append("@");
-  clientId.append(m_instanceName);  // instanceName
-  if (!m_unitName.empty()) {
-    clientId.append("@");
-    clientId.append(m_unitName);  // unitName
-  }
-  return clientId;
-}
-
-const std::string& MQClientConfigImpl::getGroupName() const {
-  return m_groupName;
-}
-
-void MQClientConfigImpl::setGroupName(const std::string& groupname) {
-  m_groupName = groupname;
-}
-
-const std::string& MQClientConfigImpl::getNamesrvAddr() const {
-  return m_namesrvAddr;
-}
-
-void MQClientConfigImpl::setNamesrvAddr(const std::string& namesrvAddr) {
-  m_namesrvAddr = NameSpaceUtil::formatNameServerURL(namesrvAddr);
-}
-
-const std::string& MQClientConfigImpl::getInstanceName() const {
-  return m_instanceName;
-}
-
-void MQClientConfigImpl::setInstanceName(const std::string& instanceName) {
-  m_instanceName = instanceName;
-}
-
-void MQClientConfigImpl::changeInstanceNameToPID() {
-  if (m_instanceName == DEFAULT_INSTANCE_NAME) {
-    m_instanceName = UtilAll::to_string(UtilAll::getProcessId());
-  }
-}
-
-const std::string& MQClientConfigImpl::getUnitName() const {
-  return m_unitName;
-}
-
-void MQClientConfigImpl::setUnitName(std::string unitName) {
-  m_unitName = unitName;
-}
-
-int MQClientConfigImpl::getTcpTransportWorkerThreadNum() const {
-  return m_tcpWorkerThreadNum;
-}
-
-void MQClientConfigImpl::setTcpTransportWorkerThreadNum(int num) {
-  if (num > m_tcpWorkerThreadNum) {
-    m_tcpWorkerThreadNum = num;
-  }
-}
-
-uint64_t MQClientConfigImpl::getTcpTransportConnectTimeout() const {
-  return m_tcpConnectTimeout;
-}
-
-void MQClientConfigImpl::setTcpTransportConnectTimeout(uint64_t timeout) {
-  m_tcpConnectTimeout = timeout;
-}
-
-uint64_t MQClientConfigImpl::getTcpTransportTryLockTimeout() const {
-  return m_tcpTransportTryLockTimeout;
-}
-
-void MQClientConfigImpl::setTcpTransportTryLockTimeout(uint64_t timeout) {
-  m_tcpTransportTryLockTimeout = std::max<uint64_t>(1000, timeout) / 1000;
-}
-
-}  // namespace rocketmq
diff --git a/src/MQClientConfigImpl.h b/src/MQClientConfigImpl.h
deleted file mode 100644
index a4e522c..0000000
--- a/src/MQClientConfigImpl.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __MQ_CLIENT_CONFIG_IMPL_H__
-#define __MQ_CLIENT_CONFIG_IMPL_H__
-
-#include "MQClientConfig.h"
-
-namespace rocketmq {
-
-/**
- * MQ Client Config
- */
-class MQClientConfigImpl : virtual public MQClientConfig {
- public:
-  MQClientConfigImpl();
-  virtual ~MQClientConfigImpl() = default;
-
-  std::string buildMQClientId() const override;
-
-  const std::string& getGroupName() const override;
-  void setGroupName(const std::string& groupname) override;
-
-  const std::string& getNamesrvAddr() const override;
-  void setNamesrvAddr(const std::string& namesrvAddr) override;
-
-  const std::string& getInstanceName() const override;
-  void setInstanceName(const std::string& instanceName) override;
-
-  void changeInstanceNameToPID() override;
-
-  const std::string& getUnitName() const override;
-  void setUnitName(std::string unitName) override;
-
-  int getTcpTransportWorkerThreadNum() const override;
-  void setTcpTransportWorkerThreadNum(int num) override;
-
-  uint64_t getTcpTransportConnectTimeout() const override;
-  void setTcpTransportConnectTimeout(uint64_t timeout) override;  // ms
-
-  uint64_t getTcpTransportTryLockTimeout() const override;
-  void setTcpTransportTryLockTimeout(uint64_t timeout) override;  // ms
-
- protected:
-  std::string m_namesrvAddr;
-  std::string m_instanceName;
-  std::string m_groupName;
-  std::string m_unitName;
-
-  int m_tcpWorkerThreadNum;
-  uint64_t m_tcpConnectTimeout;           // ms
-  uint64_t m_tcpTransportTryLockTimeout;  // s
-};
-
-}  // namespace rocketmq
-
-#endif  // __MQ_CLIENT_CONFIG_H__
diff --git a/src/MQClientConfigImpl.hpp b/src/MQClientConfigImpl.hpp
new file mode 100644
index 0000000..9eec239
--- /dev/null
+++ b/src/MQClientConfigImpl.hpp
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ROCKETMQ_MQCLIENTCONFIGIMPL_HPP_
+#define ROCKETMQ_MQCLIENTCONFIGIMPL_HPP_
+
+#include <algorithm>  // std::min, std::max
+#include <thread>     // std::thread::hardware_concurrency
+
+#include "MQClientConfig.h"
+#include "NameSpaceUtil.h"
+#include "UtilAll.h"
+
+namespace rocketmq {
+
+/**
+ * MQ Client Config
+ */
+class MQClientConfigImpl : virtual public MQClientConfig {
+ public:
+  MQClientConfigImpl()
+      : instance_name_("DEFAULT"),
+        tcp_worker_thread_num_(std::min(4, (int)std::thread::hardware_concurrency())),
+        tcp_connect_timeout(3000),
+        tcp_transport_try_lock_timeout_(3) {
+    const char* addr = std::getenv(ROCKETMQ_NAMESRV_ADDR_ENV.c_str());
+    if (addr != nullptr) {
+      namesrv_addr_ = addr;
+    }
+  }
+  virtual ~MQClientConfigImpl() = default;
+
+  std::string buildMQClientId() const override {
+    std::string clientId;
+    clientId.append(UtilAll::getLocalAddress());  // clientIP
+    clientId.append("@");
+    clientId.append(instance_name_);  // instanceName
+    if (!unit_name_.empty()) {
+      clientId.append("@");
+      clientId.append(unit_name_);  // unitName
+    }
+    return clientId;
+  }
+
+  const std::string& getGroupName() const override { return group_name_; }
+  void setGroupName(const std::string& groupname) override { group_name_ = groupname; }
+
+  const std::string& getNamesrvAddr() const override { return namesrv_addr_; }
+  void setNamesrvAddr(const std::string& namesrvAddr) override {
+    namesrv_addr_ = NameSpaceUtil::formatNameServerURL(namesrvAddr);
+  }
+
+  const std::string& getInstanceName() const override { return instance_name_; }
+  void setInstanceName(const std::string& instanceName) override { instance_name_ = instanceName; }
+
+  void changeInstanceNameToPID() override {
+    if (instance_name_ == "DEFAULT") {
+      instance_name_ = UtilAll::to_string(UtilAll::getProcessId());
+    }
+  }
+
+  const std::string& getUnitName() const override { return unit_name_; }
+  void setUnitName(std::string unitName) override { unit_name_ = unitName; }
+
+  int getTcpTransportWorkerThreadNum() const override { return tcp_worker_thread_num_; }
+  void setTcpTransportWorkerThreadNum(int num) override {
+    if (num > tcp_worker_thread_num_) {
+      tcp_worker_thread_num_ = num;
+    }
+  }
+
+  uint64_t getTcpTransportConnectTimeout() const override { return tcp_connect_timeout; }
+  void setTcpTransportConnectTimeout(uint64_t millisec) override { tcp_connect_timeout = millisec; }
+
+  uint64_t getTcpTransportTryLockTimeout() const override { return tcp_transport_try_lock_timeout_; }
+  void setTcpTransportTryLockTimeout(uint64_t millisec) override {
+    tcp_transport_try_lock_timeout_ = std::max<uint64_t>(1000, millisec) / 1000;
+  }
+
+ protected:
+  std::string namesrv_addr_;
+  std::string instance_name_;
+  std::string group_name_;
+  std::string unit_name_;
+
+  int tcp_worker_thread_num_;
+  uint64_t tcp_connect_timeout;              // ms
+  uint64_t tcp_transport_try_lock_timeout_;  // s
+};
+
+}  // namespace rocketmq
+
+#endif  // ROCKETMQ_MQCLIENTCONFIGIMPL_HPP_
diff --git a/src/MQClientImpl.cpp b/src/MQClientImpl.cpp
index 83b110c..195e680 100644
--- a/src/MQClientImpl.cpp
+++ b/src/MQClientImpl.cpp
@@ -19,7 +19,7 @@
 #include "Logging.h"
 #include "MQAdminImpl.h"
 #include "MQClientManager.h"
-#include "TopicPublishInfo.h"
+#include "TopicPublishInfo.hpp"
 #include "UtilAll.h"
 
 namespace rocketmq {
@@ -31,48 +31,48 @@ namespace rocketmq {
 const char* rocketmq_build_time = "VERSION: " ROCKETMQCPP_VERSION ", BUILD DATE: " BUILD_DATE;
 
 void MQClientImpl::start() {
-  if (nullptr == m_clientInstance) {
-    if (nullptr == m_clientConfig) {
+  if (nullptr == client_instance_) {
+    if (nullptr == client_config_) {
       THROW_MQEXCEPTION(MQClientException, "have not clientConfig for create clientInstance.", -1);
     }
 
-    m_clientInstance = MQClientManager::getInstance()->getOrCreateMQClientInstance(*m_clientConfig, m_rpcHook);
+    client_instance_ = MQClientManager::getInstance()->getOrCreateMQClientInstance(*client_config_, rpc_hook_);
   }
 
-  LOG_INFO_NEW("MQClientImpl start, clientId:{}, real nameservAddr:{}", m_clientInstance->getClientId(),
-               m_clientInstance->getNamesrvAddr());
+  LOG_INFO_NEW("MQClientImpl start, clientId:{}, real nameservAddr:{}", client_instance_->getClientId(),
+               client_instance_->getNamesrvAddr());
 }
 
 void MQClientImpl::shutdown() {
-  m_clientInstance = nullptr;
+  client_instance_ = nullptr;
 }
 
 void MQClientImpl::createTopic(const std::string& key, const std::string& newTopic, int queueNum) {
   try {
-    m_clientInstance->getMQAdminImpl()->createTopic(key, newTopic, queueNum);
+    client_instance_->getMQAdminImpl()->createTopic(key, newTopic, queueNum);
   } catch (MQException& e) {
     LOG_ERROR(e.what());
   }
 }
 
 int64_t MQClientImpl::searchOffset(const MQMessageQueue& mq, uint64_t timestamp) {
-  return m_clientInstance->getMQAdminImpl()->searchOffset(mq, timestamp);
+  return client_instance_->getMQAdminImpl()->searchOffset(mq, timestamp);
 }
 
 int64_t MQClientImpl::maxOffset(const MQMessageQueue& mq) {
-  return m_clientInstance->getMQAdminImpl()->maxOffset(mq);
+  return client_instance_->getMQAdminImpl()->maxOffset(mq);
 }
 
 int64_t MQClientImpl::minOffset(const MQMessageQueue& mq) {
-  return m_clientInstance->getMQAdminImpl()->minOffset(mq);
+  return client_instance_->getMQAdminImpl()->minOffset(mq);
 }
 
 int64_t MQClientImpl::earliestMsgStoreTime(const MQMessageQueue& mq) {
-  return m_clientInstance->getMQAdminImpl()->earliestMsgStoreTime(mq);
+  return client_instance_->getMQAdminImpl()->earliestMsgStoreTime(mq);
 }
 
 MQMessageExt MQClientImpl::viewMessage(const std::string& msgId) {
-  return m_clientInstance->getMQAdminImpl()->viewMessage(msgId);
+  return client_instance_->getMQAdminImpl()->viewMessage(msgId);
 }
 
 QueryResult MQClientImpl::queryMessage(const std::string& topic,
@@ -80,20 +80,20 @@ QueryResult MQClientImpl::queryMessage(const std::string& topic,
                                        int maxNum,
                                        int64_t begin,
                                        int64_t end) {
-  return m_clientInstance->getMQAdminImpl()->queryMessage(topic, key, maxNum, begin, end);
+  return client_instance_->getMQAdminImpl()->queryMessage(topic, key, maxNum, begin, end);
 }
 
 bool MQClientImpl::isServiceStateOk() {
-  return m_serviceState == RUNNING;
+  return service_state_ == RUNNING;
 }
 
 MQClientInstancePtr MQClientImpl::getClientInstance() const {
-  return m_clientInstance;
+  return client_instance_;
 }
 
 void MQClientImpl::setClientInstance(MQClientInstancePtr clientInstance) {
-  if (m_serviceState == CREATE_JUST) {
-    m_clientInstance = clientInstance;
+  if (service_state_ == CREATE_JUST) {
+    client_instance_ = clientInstance;
   } else {
     THROW_MQEXCEPTION(MQClientException, "Client already start, can not reset clientInstance!", -1);
   }
diff --git a/src/MQClientImpl.h b/src/MQClientImpl.h
index 0807818..879f471 100644
--- a/src/MQClientImpl.h
+++ b/src/MQClientImpl.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_IMPL_H__
-#define __MQ_CLIENT_IMPL_H__
+#ifndef ROCKETMQ_MQCLIENTIMPL_H_
+#define ROCKETMQ_MQCLIENTIMPL_H_
 
 #include "MQAdmin.h"
 #include "MQClientConfig.h"
@@ -27,7 +27,7 @@ namespace rocketmq {
 class MQClientImpl : public MQAdmin {
  public:
   MQClientImpl(MQClientConfigPtr config, RPCHookPtr rpcHook)
-      : m_clientConfig(config), m_rpcHook(rpcHook), m_serviceState(CREATE_JUST), m_clientInstance(nullptr) {}
+      : client_config_(config), rpc_hook_(rpcHook), service_state_(CREATE_JUST), client_instance_(nullptr) {}
 
  public:  // MQAdmin
   void createTopic(const std::string& key, const std::string& newTopic, int queueNum) override;
@@ -51,16 +51,16 @@ class MQClientImpl : public MQAdmin {
   MQClientInstancePtr getClientInstance() const;
   void setClientInstance(MQClientInstancePtr clientInstance);
 
-  RPCHookPtr getRPCHook() { return m_rpcHook; }
-  void setRPCHook(RPCHookPtr rpcHook) { m_rpcHook = rpcHook; }
+  RPCHookPtr getRPCHook() { return rpc_hook_; }
+  void setRPCHook(RPCHookPtr rpcHook) { rpc_hook_ = rpcHook; }
 
  protected:
-  MQClientConfigPtr m_clientConfig;
-  RPCHookPtr m_rpcHook;
-  volatile ServiceState m_serviceState;
-  MQClientInstancePtr m_clientInstance;
+  MQClientConfigPtr client_config_;
+  RPCHookPtr rpc_hook_;
+  volatile ServiceState service_state_;
+  MQClientInstancePtr client_instance_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_IMPL_H__
+#endif  // ROCKETMQ_MQCLIENTIMPL_H_
diff --git a/src/MQClientInstance.cpp b/src/MQClientInstance.cpp
index 213d74b..fa58bde 100644
--- a/src/MQClientInstance.cpp
+++ b/src/MQClientInstance.cpp
@@ -31,13 +31,9 @@
 #include "RebalanceImpl.h"
 #include "RebalanceService.h"
 #include "TcpRemotingClient.h"
-#include "TopicPublishInfo.h"
+#include "TopicPublishInfo.hpp"
 #include "UtilAll.h"
 
-#define MAX_BUFF_SIZE 8192
-#define PROCESS_NAME_BUF_SIZE 256
-#define SAFE_BUFF_SIZE (MAX_BUFF_SIZE - PROCESS_NAME_BUF_SIZE)  // 8192 - 256 = 7936
-
 namespace rocketmq {
 
 static const long LOCK_TIMEOUT_MILLIS = 3000L;
@@ -46,44 +42,44 @@ MQClientInstance::MQClientInstance(const MQClientConfig& clientConfig, const std
     : MQClientInstance(clientConfig, clientId, nullptr) {}
 
 MQClientInstance::MQClientInstance(const MQClientConfig& clientConfig, const std::string& clientId, RPCHookPtr rpcHook)
-    : m_clientId(clientId),
-      m_rebalanceService(new RebalanceService(this)),
-      m_pullMessageService(new PullMessageService(this)),
-      m_scheduledExecutorService("MQClient", false) {
+    : client_id_(clientId),
+      rebalance_service_(new RebalanceService(this)),
+      pull_message_service_(new PullMessageService(this)),
+      scheduled_executor_service_("MQClient", false) {
   // default Topic register
   TopicPublishInfoPtr defaultTopicInfo(new TopicPublishInfo());
-  m_topicPublishInfoTable[AUTO_CREATE_TOPIC_KEY_TOPIC] = defaultTopicInfo;
+  topic_publish_info_table_[AUTO_CREATE_TOPIC_KEY_TOPIC] = defaultTopicInfo;
 
-  m_clientRemotingProcessor.reset(new ClientRemotingProcessor(this));
-  m_mqClientAPIImpl.reset(new MQClientAPIImpl(m_clientRemotingProcessor.get(), rpcHook, clientConfig));
+  client_remoting_processor_.reset(new ClientRemotingProcessor(this));
+  mq_client_api_impl_.reset(new MQClientAPIImpl(client_remoting_processor_.get(), rpcHook, clientConfig));
 
   std::string namesrvAddr = clientConfig.getNamesrvAddr();
   if (!namesrvAddr.empty()) {
-    m_mqClientAPIImpl->updateNameServerAddr(namesrvAddr);
+    mq_client_api_impl_->updateNameServerAddressList(namesrvAddr);
     LOG_INFO_NEW("user specified name server address: {}", namesrvAddr);
   }
 
-  m_mqAdminImpl.reset(new MQAdminImpl(this));
+  mq_admin_impl_.reset(new MQAdminImpl(this));
 
-  m_serviceState = CREATE_JUST;
+  service_state_ = CREATE_JUST;
   LOG_DEBUG_NEW("MQClientInstance construct");
 }
 
 MQClientInstance::~MQClientInstance() {
-  LOG_INFO_NEW("MQClientInstance:{} destruct", m_clientId);
+  LOG_INFO_NEW("MQClientInstance:{} destruct", client_id_);
 
   // UNNECESSARY:
-  m_producerTable.clear();
-  m_consumerTable.clear();
-  m_topicPublishInfoTable.clear();
-  m_topicRouteTable.clear();
-  m_brokerAddrTable.clear();
+  producer_table_.clear();
+  consumer_table_.clear();
+  topic_publish_info_table_.clear();
+  topic_route_table_.clear();
+  broker_addr_table_.clear();
 
-  m_mqClientAPIImpl = nullptr;
+  mq_client_api_impl_ = nullptr;
 }
 
 std::string MQClientInstance::getNamesrvAddr() const {
-  auto namesrvAddrs = m_mqClientAPIImpl->getRemotingClient()->getNameServerAddressList();
+  auto namesrvAddrs = mq_client_api_impl_->getRemotingClient()->getNameServerAddressList();
   std::ostringstream oss;
   for (const auto& addr : namesrvAddrs) {
     oss << addr << ";";
@@ -98,7 +94,7 @@ TopicPublishInfoPtr MQClientInstance::topicRouteData2TopicPublishInfo(const std:
 
   auto& mqList = const_cast<TopicPublishInfo::QueuesVec&>(info->getMessageQueueList());
 
-  std::string orderTopicConf = route->getOrderTopicConf();
+  std::string orderTopicConf = route->order_topic_conf();
   if (!orderTopicConf.empty()) {  // order msg
     // "broker-a:8";"broker-b:8"
     std::vector<std::string> brokers;
@@ -113,38 +109,38 @@ TopicPublishInfoPtr MQClientInstance::topicRouteData2TopicPublishInfo(const std:
     }
     info->setOrderTopic(true);
   } else {  // no order msg
-    const auto& qds = route->getQueueDatas();
+    const auto& qds = route->queue_datas();
     for (const auto& qd : qds) {
-      if (PermName::isWriteable(qd.perm)) {
+      if (PermName::isWriteable(qd.perm())) {
         const BrokerData* brokerData = nullptr;
-        for (const auto& bd : route->getBrokerDatas()) {
-          if (bd.brokerName == qd.brokerName) {
+        for (const auto& bd : route->broker_datas()) {
+          if (bd.broker_name() == qd.broker_name()) {
             brokerData = &bd;
             break;
           }
         }
 
         if (nullptr == brokerData) {
-          LOG_WARN_NEW("MQClientInstance: broker:{} of topic:{} have not data", qd.brokerName, topic);
+          LOG_WARN_NEW("MQClientInstance: broker:{} of topic:{} have not data", qd.broker_name(), topic);
           continue;
         }
 
-        if (brokerData->brokerAddrs.find(MASTER_ID) == brokerData->brokerAddrs.end()) {
-          LOG_WARN_NEW("MQClientInstance: broker:{} of topic:{} have not master node", qd.brokerName, topic);
+        if (brokerData->broker_addrs().find(MASTER_ID) == brokerData->broker_addrs().end()) {
+          LOG_WARN_NEW("MQClientInstance: broker:{} of topic:{} have not master node", qd.broker_name(), topic);
           continue;
         }
 
-        for (int i = 0; i < qd.writeQueueNums; i++) {
-          mqList.emplace_back(topic, qd.brokerName, i);
+        for (int i = 0; i < qd.write_queue_nums(); i++) {
+          mqList.emplace_back(topic, qd.broker_name(), i);
         }
       }
     }
 
     // sort, make brokerName is staggered.
     std::sort(mqList.begin(), mqList.end(), [](const MQMessageQueue& a, const MQMessageQueue& b) {
-      auto result = a.getQueueId() - b.getQueueId();
+      auto result = a.queue_id() - b.queue_id();
       if (result == 0) {
-        result = a.getBrokerName().compare(b.getBrokerName());
+        result = a.broker_name().compare(b.broker_name());
       }
       return result < 0;
     });
@@ -158,11 +154,11 @@ TopicPublishInfoPtr MQClientInstance::topicRouteData2TopicPublishInfo(const std:
 std::vector<MQMessageQueue> MQClientInstance::topicRouteData2TopicSubscribeInfo(const std::string& topic,
                                                                                 TopicRouteDataPtr route) {
   std::vector<MQMessageQueue> mqList;
-  const auto& queueDatas = route->getQueueDatas();
+  const auto& queueDatas = route->queue_datas();
   for (const auto& qd : queueDatas) {
-    if (PermName::isReadable(qd.perm)) {
-      for (int i = 0; i < qd.readQueueNums; i++) {
-        MQMessageQueue mq(topic, qd.brokerName, i);
+    if (PermName::isReadable(qd.perm())) {
+      for (int i = 0; i < qd.read_queue_nums(); i++) {
+        MQMessageQueue mq(topic, qd.broker_name(), i);
         mqList.push_back(mq);
       }
     }
@@ -171,31 +167,31 @@ std::vector<MQMessageQueue> MQClientInstance::topicRouteData2TopicSubscribeInfo(
 }
 
 void MQClientInstance::start() {
-  switch (m_serviceState) {
+  switch (service_state_) {
     case CREATE_JUST:
-      LOG_INFO_NEW("the client instance [{}] is starting", m_clientId);
-      m_serviceState = START_FAILED;
+      LOG_INFO_NEW("the client instance [{}] is starting", client_id_);
+      service_state_ = START_FAILED;
 
-      m_mqClientAPIImpl->start();
+      mq_client_api_impl_->start();
 
       // start various schedule tasks
       startScheduledTask();
 
       // start pull service
-      m_pullMessageService->start();
+      pull_message_service_->start();
 
       // start rebalance service
-      m_rebalanceService->start();
+      rebalance_service_->start();
 
-      LOG_INFO_NEW("the client instance [{}] start OK", m_clientId);
-      m_serviceState = RUNNING;
+      LOG_INFO_NEW("the client instance [{}] start OK", client_id_);
+      service_state_ = RUNNING;
       break;
     case RUNNING:
-      LOG_INFO_NEW("the client instance [{}] already running.", m_clientId, m_serviceState);
+      LOG_INFO_NEW("the client instance [{}] already running.", client_id_, service_state_);
       break;
     case SHUTDOWN_ALREADY:
     case START_FAILED:
-      LOG_INFO_NEW("the client instance [{}] start failed with fault state:{}", m_clientId, m_serviceState);
+      LOG_INFO_NEW("the client instance [{}] start failed with fault state:{}", client_id_, service_state_);
       break;
     default:
       break;
@@ -211,18 +207,18 @@ void MQClientInstance::shutdown() {
     return;
   }
 
-  switch (m_serviceState) {
+  switch (service_state_) {
     case CREATE_JUST:
       break;
     case RUNNING: {
-      m_serviceState = SHUTDOWN_ALREADY;
-      m_pullMessageService->shutdown();
-      m_scheduledExecutorService.shutdown();
-      m_mqClientAPIImpl->shutdown();
-      m_rebalanceService->shutdown();
-
-      MQClientManager::getInstance()->removeMQClientInstance(m_clientId);
-      LOG_INFO_NEW("the client instance [{}] shutdown OK", m_clientId);
+      service_state_ = SHUTDOWN_ALREADY;
+      pull_message_service_->shutdown();
+      scheduled_executor_service_.shutdown();
+      mq_client_api_impl_->shutdown();
+      rebalance_service_->shutdown();
+
+      MQClientManager::getInstance()->removeMQClientInstance(client_id_);
+      LOG_INFO_NEW("the client instance [{}] shutdown OK", client_id_);
     } break;
     case SHUTDOWN_ALREADY:
       break;
@@ -232,32 +228,32 @@ void MQClientInstance::shutdown() {
 }
 
 bool MQClientInstance::isRunning() {
-  return m_serviceState == RUNNING;
+  return service_state_ == RUNNING;
 }
 
 void MQClientInstance::startScheduledTask() {
-  LOG_INFO_NEW("start scheduled task:{}", m_clientId);
-  m_scheduledExecutorService.startup();
+  LOG_INFO_NEW("start scheduled task:{}", client_id_);
+  scheduled_executor_service_.startup();
 
   // updateTopicRouteInfoFromNameServer
-  m_scheduledExecutorService.schedule(std::bind(&MQClientInstance::updateTopicRouteInfoPeriodically, this), 10,
-                                      time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&MQClientInstance::updateTopicRouteInfoPeriodically, this), 10,
+                                       time_unit::milliseconds);
 
   // sendHeartbeatToAllBroker
-  m_scheduledExecutorService.schedule(std::bind(&MQClientInstance::sendHeartbeatToAllBrokerPeriodically, this), 1000,
-                                      time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&MQClientInstance::sendHeartbeatToAllBrokerPeriodically, this), 1000,
+                                       time_unit::milliseconds);
 
   // persistAllConsumerOffset
-  m_scheduledExecutorService.schedule(std::bind(&MQClientInstance::persistAllConsumerOffsetPeriodically, this),
-                                      1000 * 10, time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&MQClientInstance::persistAllConsumerOffsetPeriodically, this),
+                                       1000 * 10, time_unit::milliseconds);
 }
 
 void MQClientInstance::updateTopicRouteInfoPeriodically() {
   updateTopicRouteInfoFromNameServer();
 
   // next round
-  m_scheduledExecutorService.schedule(std::bind(&MQClientInstance::updateTopicRouteInfoPeriodically, this), 1000 * 30,
-                                      time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&MQClientInstance::updateTopicRouteInfoPeriodically, this), 1000 * 30,
+                                       time_unit::milliseconds);
 }
 
 void MQClientInstance::sendHeartbeatToAllBrokerPeriodically() {
@@ -265,20 +261,20 @@ void MQClientInstance::sendHeartbeatToAllBrokerPeriodically() {
   sendHeartbeatToAllBrokerWithLock();
 
   // next round
-  m_scheduledExecutorService.schedule(std::bind(&MQClientInstance::sendHeartbeatToAllBrokerPeriodically, this),
-                                      1000 * 30, time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&MQClientInstance::sendHeartbeatToAllBrokerPeriodically, this),
+                                       1000 * 30, time_unit::milliseconds);
 }
 
 void MQClientInstance::persistAllConsumerOffsetPeriodically() {
   persistAllConsumerOffset();
 
   // next round
-  m_scheduledExecutorService.schedule(std::bind(&MQClientInstance::persistAllConsumerOffsetPeriodically, this),
-                                      1000 * 5, time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&MQClientInstance::persistAllConsumerOffsetPeriodically, this),
+                                       1000 * 5, time_unit::milliseconds);
 }
 
 const std::string& MQClientInstance::getClientId() const {
-  return m_clientId;
+  return client_id_;
 }
 
 void MQClientInstance::updateTopicRouteInfoFromNameServer() {
@@ -299,8 +295,8 @@ void MQClientInstance::updateTopicRouteInfoFromNameServer() {
 }
 
 void MQClientInstance::cleanOfflineBroker() {
-  if (UtilAll::try_lock_for(m_lockNamesrv, LOCK_TIMEOUT_MILLIS)) {
-    std::lock_guard<std::timed_mutex> lock(m_lockNamesrv, std::adopt_lock);
+  if (UtilAll::try_lock_for(lock_namesrv_, LOCK_TIMEOUT_MILLIS)) {
+    std::lock_guard<std::timed_mutex> lock(lock_namesrv_, std::adopt_lock);
 
     std::set<std::string> offlineBrokers;
     BrokerAddrMAP updatedTable(getBrokerAddrTable());
@@ -330,10 +326,10 @@ void MQClientInstance::cleanOfflineBroker() {
     if (offlineBrokers.size() > 0) {
       resetBrokerAddrTable(std::move(updatedTable));
 
-      std::lock_guard<std::mutex> lock(m_topicBrokerAddrTableMutex);
-      for (auto it = m_topicBrokerAddrTable.begin(); it != m_topicBrokerAddrTable.end();) {
+      std::lock_guard<std::mutex> lock(topic_broker_addr_table_mutex_);
+      for (auto it = topic_broker_addr_table_.begin(); it != topic_broker_addr_table_.end();) {
         if (offlineBrokers.find(it->second.first) != offlineBrokers.end()) {
-          it = m_topicBrokerAddrTable.erase(it);
+          it = topic_broker_addr_table_.erase(it);
         } else {
           it++;
         }
@@ -345,12 +341,12 @@ void MQClientInstance::cleanOfflineBroker() {
 }
 
 bool MQClientInstance::isBrokerAddrExistInTopicRouteTable(const std::string& addr) {
-  std::lock_guard<std::mutex> lock(m_topicRouteTableMutex);
-  for (const auto& it : m_topicRouteTable) {
+  std::lock_guard<std::mutex> lock(topic_route_table_mutex_);
+  for (const auto& it : topic_route_table_) {
     const auto topicRouteData = it.second;
-    const auto& bds = topicRouteData->getBrokerDatas();
+    const auto& bds = topicRouteData->broker_datas();
     for (const auto& bd : bds) {
-      for (const auto& itAddr : bd.brokerAddrs) {
+      for (const auto& itAddr : bd.broker_addrs()) {
         if (itAddr.second == addr) {
           return true;
         }
@@ -361,8 +357,8 @@ bool MQClientInstance::isBrokerAddrExistInTopicRouteTable(const std::string& add
 }
 
 void MQClientInstance::sendHeartbeatToAllBrokerWithLock() {
-  if (m_lockHeartbeat.try_lock()) {
-    std::lock_guard<std::timed_mutex> lock(m_lockHeartbeat, std::adopt_lock);
+  if (lock_heartbeat_.try_lock()) {
+    std::lock_guard<std::timed_mutex> lock(lock_heartbeat_, std::adopt_lock);
     sendHeartbeatToAllBroker();
   } else {
     LOG_WARN_NEW("lock heartBeat, but failed.");
@@ -370,9 +366,9 @@ void MQClientInstance::sendHeartbeatToAllBrokerWithLock() {
 }
 
 void MQClientInstance::persistAllConsumerOffset() {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  for (const auto& it : m_consumerTable) {
-    LOG_DEBUG_NEW("the client instance [{}] start persistAllConsumerOffset", m_clientId);
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  for (const auto& it : consumer_table_) {
+    LOG_DEBUG_NEW("the client instance [{}] start persistAllConsumerOffset", client_id_);
     it.second->persistConsumerOffset();
   }
 }
@@ -399,7 +395,7 @@ void MQClientInstance::sendHeartbeatToAllBroker() {
         }
 
         try {
-          m_mqClientAPIImpl->sendHearbeat(addr, heartbeatData.get(), 3000);
+          mq_client_api_impl_->sendHearbeat(addr, heartbeatData.get(), 3000);
         } catch (const MQException& e) {
           LOG_ERROR_NEW("{}", e.what());
         }
@@ -412,25 +408,26 @@ void MQClientInstance::sendHeartbeatToAllBroker() {
 }
 
 bool MQClientInstance::updateTopicRouteInfoFromNameServer(const std::string& topic, bool isDefault) {
-  if (UtilAll::try_lock_for(m_lockNamesrv, LOCK_TIMEOUT_MILLIS)) {
-    std::lock_guard<std::timed_mutex> lock(m_lockNamesrv, std::adopt_lock);
+  if (UtilAll::try_lock_for(lock_namesrv_, LOCK_TIMEOUT_MILLIS)) {
+    std::lock_guard<std::timed_mutex> lock(lock_namesrv_, std::adopt_lock);
     LOG_DEBUG_NEW("updateTopicRouteInfoFromNameServer start:{}", topic);
 
     try {
       TopicRouteDataPtr topicRouteData;
       if (isDefault) {
-        topicRouteData.reset(m_mqClientAPIImpl->getTopicRouteInfoFromNameServer(AUTO_CREATE_TOPIC_KEY_TOPIC, 1000 * 3));
+        topicRouteData.reset(
+            mq_client_api_impl_->getTopicRouteInfoFromNameServer(AUTO_CREATE_TOPIC_KEY_TOPIC, 1000 * 3));
         if (topicRouteData != nullptr) {
-          auto& queueDatas = topicRouteData->getQueueDatas();
+          auto& queueDatas = topicRouteData->queue_datas();
           for (auto& qd : queueDatas) {
-            int queueNums = std::min(4, qd.readQueueNums);
-            qd.readQueueNums = queueNums;
-            qd.writeQueueNums = queueNums;
+            int queueNums = std::min(4, qd.read_queue_nums());
+            qd.set_read_queue_nums(queueNums);
+            qd.set_write_queue_nums(queueNums);
           }
         }
         LOG_DEBUG_NEW("getTopicRouteInfoFromNameServer is null for topic: {}", topic);
       } else {
-        topicRouteData.reset(m_mqClientAPIImpl->getTopicRouteInfoFromNameServer(topic, 1000 * 3));
+        topicRouteData.reset(mq_client_api_impl_->getTopicRouteInfoFromNameServer(topic, 1000 * 3));
       }
       if (topicRouteData != nullptr) {
         LOG_INFO_NEW("updateTopicRouteInfoFromNameServer has data");
@@ -441,10 +438,10 @@ bool MQClientInstance::updateTopicRouteInfoFromNameServer(const std::string& top
           LOG_INFO_NEW("updateTopicRouteInfoFromNameServer changed:{}", topic);
 
           // update broker addr
-          const auto& brokerDatas = topicRouteData->getBrokerDatas();
+          const auto& brokerDatas = topicRouteData->broker_datas();
           for (const auto& bd : brokerDatas) {
-            LOG_INFO_NEW("updateTopicRouteInfoFromNameServer changed with broker name:{}", bd.brokerName);
-            addBrokerToAddrTable(bd.brokerName, bd.brokerAddrs);
+            LOG_INFO_NEW("updateTopicRouteInfoFromNameServer changed with broker name:{}", bd.broker_name());
+            addBrokerToAddrTable(bd.broker_name(), bd.broker_addrs());
           }
 
           // update publish info
@@ -484,7 +481,7 @@ HeartbeatData* MQClientInstance::prepareHeartbeatData() {
   HeartbeatData* pHeartbeatData = new HeartbeatData();
 
   // clientID
-  pHeartbeatData->setClientID(m_clientId);
+  pHeartbeatData->setClientID(client_id_);
 
   // Consumer
   insertConsumerInfoToHeartBeatData(pHeartbeatData);
@@ -496,8 +493,8 @@ HeartbeatData* MQClientInstance::prepareHeartbeatData() {
 }
 
 void MQClientInstance::insertConsumerInfoToHeartBeatData(HeartbeatData* pHeartbeatData) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  for (const auto& it : m_consumerTable) {
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  for (const auto& it : consumer_table_) {
     const auto* consumer = it.second;
     ConsumerData consumerData;
     consumerData.groupName = consumer->groupName();
@@ -513,8 +510,8 @@ void MQClientInstance::insertConsumerInfoToHeartBeatData(HeartbeatData* pHeartbe
 }
 
 void MQClientInstance::insertProducerInfoToHeartBeatData(HeartbeatData* pHeartbeatData) {
-  std::lock_guard<std::mutex> lock(m_producerTableMutex);
-  for (const auto& it : m_producerTable) {
+  std::lock_guard<std::mutex> lock(producer_table_mutex_);
+  for (const auto& it : producer_table_) {
     ProducerData producerData;
     producerData.groupName = it.first;
     pHeartbeatData->insertDataToProducerDataSet(producerData);
@@ -529,17 +526,17 @@ bool MQClientInstance::topicRouteDataIsChange(TopicRouteData* olddata, TopicRout
 }
 
 TopicRouteDataPtr MQClientInstance::getTopicRouteData(const std::string& topic) {
-  std::lock_guard<std::mutex> lock(m_topicRouteTableMutex);
-  const auto& it = m_topicRouteTable.find(topic);
-  if (it != m_topicRouteTable.end()) {
+  std::lock_guard<std::mutex> lock(topic_route_table_mutex_);
+  const auto& it = topic_route_table_.find(topic);
+  if (it != topic_route_table_.end()) {
     return it->second;
   }
   return nullptr;
 }
 
 void MQClientInstance::addTopicRouteData(const std::string& topic, TopicRouteDataPtr topicRouteData) {
-  std::lock_guard<std::mutex> lock(m_topicRouteTableMutex);
-  m_topicRouteTable[topic] = topicRouteData;
+  std::lock_guard<std::mutex> lock(topic_route_table_mutex_);
+  topic_route_table_[topic] = topicRouteData;
 }
 
 bool MQClientInstance::registerConsumer(const std::string& group, MQConsumerInner* consumer) {
@@ -562,8 +559,8 @@ void MQClientInstance::unregisterConsumer(const std::string& group) {
 }
 
 void MQClientInstance::unregisterClientWithLock(const std::string& producerGroup, const std::string& consumerGroup) {
-  if (UtilAll::try_lock_for(m_lockHeartbeat, LOCK_TIMEOUT_MILLIS)) {
-    std::lock_guard<std::timed_mutex> lock(m_lockHeartbeat, std::adopt_lock);
+  if (UtilAll::try_lock_for(lock_heartbeat_, LOCK_TIMEOUT_MILLIS)) {
+    std::lock_guard<std::timed_mutex> lock(lock_heartbeat_, std::adopt_lock);
 
     try {
       unregisterClient(producerGroup, consumerGroup);
@@ -584,7 +581,7 @@ void MQClientInstance::unregisterClient(const std::string& producerGroup, const
       const auto& index = it2.first;
       const auto& addr = it2.second;
       try {
-        m_mqClientAPIImpl->unregisterClient(addr, m_clientId, producerGroup, consumerGroup);
+        mq_client_api_impl_->unregisterClient(addr, client_id_, producerGroup, consumerGroup);
         LOG_INFO_NEW("unregister client[Producer: {} Consumer: {}] from broker[{} {} {}] success", producerGroup,
                      consumerGroup, brokerName, index, addr);
       } catch (const std::exception& e) {
@@ -614,26 +611,26 @@ void MQClientInstance::unregisterProducer(const std::string& group) {
 }
 
 void MQClientInstance::rebalanceImmediately() {
-  m_rebalanceService->wakeup();
+  rebalance_service_->wakeup();
 }
 
 void MQClientInstance::doRebalance() {
-  LOG_INFO_NEW("the client instance:{} start doRebalance", m_clientId);
+  LOG_INFO_NEW("the client instance:{} start doRebalance", client_id_);
   if (getConsumerTableSize() > 0) {
-    std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-    for (auto& it : m_consumerTable) {
+    std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+    for (auto& it : consumer_table_) {
       it.second->doRebalance();
     }
   }
-  LOG_INFO_NEW("the client instance [{}] finish doRebalance", m_clientId);
+  LOG_INFO_NEW("the client instance [{}] finish doRebalance", client_id_);
 }
 
 void MQClientInstance::doRebalanceByConsumerGroup(const std::string& consumerGroup) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  const auto& it = m_consumerTable.find(consumerGroup);
-  if (it != m_consumerTable.end()) {
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  const auto& it = consumer_table_.find(consumerGroup);
+  if (it != consumer_table_.end()) {
     try {
-      LOG_INFO_NEW("the client instance [{}] start doRebalance for consumer [{}]", m_clientId, consumerGroup);
+      LOG_INFO_NEW("the client instance [{}] start doRebalance for consumer [{}]", client_id_, consumerGroup);
       auto* consumer = it->second;
       consumer->doRebalance();
     } catch (const std::exception& e) {
@@ -643,40 +640,40 @@ void MQClientInstance::doRebalanceByConsumerGroup(const std::string& consumerGro
 }
 
 MQProducerInner* MQClientInstance::selectProducer(const std::string& producerName) {
-  std::lock_guard<std::mutex> lock(m_producerTableMutex);
-  const auto& it = m_producerTable.find(producerName);
-  if (it != m_producerTable.end()) {
+  std::lock_guard<std::mutex> lock(producer_table_mutex_);
+  const auto& it = producer_table_.find(producerName);
+  if (it != producer_table_.end()) {
     return it->second;
   }
   return nullptr;
 }
 
 bool MQClientInstance::addProducerToTable(const std::string& producerName, MQProducerInner* producer) {
-  std::lock_guard<std::mutex> lock(m_producerTableMutex);
-  if (m_producerTable.find(producerName) != m_producerTable.end()) {
+  std::lock_guard<std::mutex> lock(producer_table_mutex_);
+  if (producer_table_.find(producerName) != producer_table_.end()) {
     return false;
   } else {
-    m_producerTable[producerName] = producer;
+    producer_table_[producerName] = producer;
     return true;
   }
 }
 
 void MQClientInstance::eraseProducerFromTable(const std::string& producerName) {
-  std::lock_guard<std::mutex> lock(m_producerTableMutex);
-  const auto& it = m_producerTable.find(producerName);
-  if (it != m_producerTable.end()) {
-    m_producerTable.erase(it);
+  std::lock_guard<std::mutex> lock(producer_table_mutex_);
+  const auto& it = producer_table_.find(producerName);
+  if (it != producer_table_.end()) {
+    producer_table_.erase(it);
   }
 }
 
 int MQClientInstance::getProducerTableSize() {
-  std::lock_guard<std::mutex> lock(m_producerTableMutex);
-  return m_producerTable.size();
+  std::lock_guard<std::mutex> lock(producer_table_mutex_);
+  return producer_table_.size();
 }
 
 void MQClientInstance::getTopicListFromTopicPublishInfo(std::set<std::string>& topicList) {
-  std::lock_guard<std::mutex> lock(m_topicPublishInfoTableMutex);
-  for (const auto& it : m_topicPublishInfoTable) {
+  std::lock_guard<std::mutex> lock(topic_publish_info_table_mutex_);
+  for (const auto& it : topic_publish_info_table_) {
     topicList.insert(it.first);
   }
 }
@@ -686,82 +683,82 @@ void MQClientInstance::updateProducerTopicPublishInfo(const std::string& topic,
 }
 
 MQConsumerInner* MQClientInstance::selectConsumer(const std::string& group) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  const auto& it = m_consumerTable.find(group);
-  if (it != m_consumerTable.end()) {
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  const auto& it = consumer_table_.find(group);
+  if (it != consumer_table_.end()) {
     return it->second;
   }
   return nullptr;
 }
 
 bool MQClientInstance::addConsumerToTable(const std::string& consumerName, MQConsumerInner* consumer) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  if (m_consumerTable.find(consumerName) != m_consumerTable.end()) {
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  if (consumer_table_.find(consumerName) != consumer_table_.end()) {
     return false;
   } else {
-    m_consumerTable[consumerName] = consumer;
+    consumer_table_[consumerName] = consumer;
     return true;
   }
 }
 
 void MQClientInstance::eraseConsumerFromTable(const std::string& consumerName) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  const auto& it = m_consumerTable.find(consumerName);
-  if (it != m_consumerTable.end()) {
-    m_consumerTable.erase(it);  // do not need free consumer, as it was allocated by user
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  const auto& it = consumer_table_.find(consumerName);
+  if (it != consumer_table_.end()) {
+    consumer_table_.erase(it);  // do not need free consumer, as it was allocated by user
   } else {
     LOG_WARN_NEW("could not find consumer:{} from table", consumerName);
   }
 }
 
 int MQClientInstance::getConsumerTableSize() {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  return m_consumerTable.size();
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  return consumer_table_.size();
 }
 
 void MQClientInstance::getTopicListFromConsumerSubscription(std::set<std::string>& topicList) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  for (const auto& it : m_consumerTable) {
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  for (const auto& it : consumer_table_) {
     std::vector<SubscriptionData> result = it.second->subscriptions();
     for (const auto& sd : result) {
-      topicList.insert(sd.getTopic());
+      topicList.insert(sd.topic());
     }
   }
 }
 
 void MQClientInstance::updateConsumerTopicSubscribeInfo(const std::string& topic,
                                                         std::vector<MQMessageQueue> subscribeInfo) {
-  std::lock_guard<std::mutex> lock(m_consumerTableMutex);
-  for (auto& it : m_consumerTable) {
+  std::lock_guard<std::mutex> lock(consumer_table_mutex_);
+  for (auto& it : consumer_table_) {
     it.second->updateTopicSubscribeInfo(topic, subscribeInfo);
   }
 }
 
 void MQClientInstance::addTopicInfoToTable(const std::string& topic, TopicPublishInfoPtr topicPublishInfo) {
-  std::lock_guard<std::mutex> lock(m_topicPublishInfoTableMutex);
-  m_topicPublishInfoTable[topic] = topicPublishInfo;
+  std::lock_guard<std::mutex> lock(topic_publish_info_table_mutex_);
+  topic_publish_info_table_[topic] = topicPublishInfo;
 }
 
 void MQClientInstance::eraseTopicInfoFromTable(const std::string& topic) {
-  std::lock_guard<std::mutex> lock(m_topicPublishInfoTableMutex);
-  const auto& it = m_topicPublishInfoTable.find(topic);
-  if (it != m_topicPublishInfoTable.end()) {
-    m_topicPublishInfoTable.erase(it);
+  std::lock_guard<std::mutex> lock(topic_publish_info_table_mutex_);
+  const auto& it = topic_publish_info_table_.find(topic);
+  if (it != topic_publish_info_table_.end()) {
+    topic_publish_info_table_.erase(it);
   }
 }
 
 TopicPublishInfoPtr MQClientInstance::getTopicPublishInfoFromTable(const std::string& topic) {
-  std::lock_guard<std::mutex> lock(m_topicPublishInfoTableMutex);
-  const auto& it = m_topicPublishInfoTable.find(topic);
-  if (it != m_topicPublishInfoTable.end()) {
+  std::lock_guard<std::mutex> lock(topic_publish_info_table_mutex_);
+  const auto& it = topic_publish_info_table_.find(topic);
+  if (it != topic_publish_info_table_.end()) {
     return it->second;
   }
   return nullptr;
 }
 
 bool MQClientInstance::isTopicInfoValidInTable(const std::string& topic) {
-  std::lock_guard<std::mutex> lock(m_topicPublishInfoTableMutex);
-  return m_topicPublishInfoTable.find(topic) != m_topicPublishInfoTable.end();
+  std::lock_guard<std::mutex> lock(topic_publish_info_table_mutex_);
+  return topic_publish_info_table_.find(topic) != topic_publish_info_table_.end();
 }
 
 TopicPublishInfoPtr MQClientInstance::tryToFindTopicPublishInfo(const std::string& topic) {
@@ -870,9 +867,9 @@ void MQClientInstance::findConsumerIds(const std::string& topic,
 
   // find consumerIds from same broker every 40s
   {
-    std::lock_guard<std::mutex> lock(m_topicBrokerAddrTableMutex);
-    const auto& it = m_topicBrokerAddrTable.find(topic);
-    if (it != m_topicBrokerAddrTable.end()) {
+    std::lock_guard<std::mutex> lock(topic_broker_addr_table_mutex_);
+    const auto& it = topic_broker_addr_table_.find(topic);
+    if (it != topic_broker_addr_table_.end()) {
       if (UtilAll::currentTimeMillis() < it->second.second + 120000) {
         brokerAddr = it->second.first;
       }
@@ -888,20 +885,20 @@ void MQClientInstance::findConsumerIds(const std::string& topic,
     }
 
     if (!brokerAddr.empty()) {
-      std::lock_guard<std::mutex> lock(m_topicBrokerAddrTableMutex);
-      m_topicBrokerAddrTable[topic] = std::make_pair(brokerAddr, UtilAll::currentTimeMillis());
+      std::lock_guard<std::mutex> lock(topic_broker_addr_table_mutex_);
+      topic_broker_addr_table_[topic] = std::make_pair(brokerAddr, UtilAll::currentTimeMillis());
     }
   }
 
   if (!brokerAddr.empty()) {
     try {
       LOG_INFO_NEW("getConsumerIdList from broker:{}", brokerAddr);
-      return m_mqClientAPIImpl->getConsumerIdListByGroup(brokerAddr, group, cids, 5000);
+      return mq_client_api_impl_->getConsumerIdListByGroup(brokerAddr, group, cids, 5000);
     } catch (const MQException& e) {
       LOG_ERROR_NEW("encounter exception when getConsumerIdList: {}", e.what());
 
-      std::lock_guard<std::mutex> lock(m_topicBrokerAddrTableMutex);
-      m_topicBrokerAddrTable.erase(topic);
+      std::lock_guard<std::mutex> lock(topic_broker_addr_table_mutex_);
+      topic_broker_addr_table_.erase(topic);
     }
   }
 }
@@ -931,9 +928,9 @@ void MQClientInstance::resetOffset(const std::string& group,
     auto processQueueTable = consumer->getRebalanceImpl()->getProcessQueueTable();
     for (const auto& it : processQueueTable) {
       const auto& mq = it.first;
-      if (topic == mq.getTopic() && offsetTable.find(mq) != offsetTable.end()) {
+      if (topic == mq.topic() && offsetTable.find(mq) != offsetTable.end()) {
         auto pq = it.second;
-        pq->setDropped(true);
+        pq->set_dropped(true);
         pq->clearAllMsgs();
       }
     }
@@ -976,7 +973,7 @@ ConsumerRunningInfo* MQClientInstance::consumerRunningInfo(const std::string& co
       }
 
       runningInfo->setProperty(ConsumerRunningInfo::PROP_CLIENT_VERSION,
-                               MQVersion::GetVersionDesc(MQVersion::s_CurrentVersion));
+                               MQVersion::GetVersionDesc(MQVersion::CURRENT_VERSION));
 
       return runningInfo.release();
     }
@@ -988,23 +985,23 @@ ConsumerRunningInfo* MQClientInstance::consumerRunningInfo(const std::string& co
 
 void MQClientInstance::addBrokerToAddrTable(const std::string& brokerName,
                                             const std::map<int, std::string>& brokerAddrs) {
-  std::lock_guard<std::mutex> lock(m_brokerAddrTableMutex);
-  m_brokerAddrTable[brokerName] = brokerAddrs;
+  std::lock_guard<std::mutex> lock(broker_addr_table_mutex_);
+  broker_addr_table_[brokerName] = brokerAddrs;
 }
 
 void MQClientInstance::resetBrokerAddrTable(BrokerAddrMAP&& table) {
-  std::lock_guard<std::mutex> lock(m_brokerAddrTableMutex);
-  m_brokerAddrTable = std::forward<BrokerAddrMAP>(table);
+  std::lock_guard<std::mutex> lock(broker_addr_table_mutex_);
+  broker_addr_table_ = std::forward<BrokerAddrMAP>(table);
 }
 
 void MQClientInstance::clearBrokerAddrTable() {
-  std::lock_guard<std::mutex> lock(m_brokerAddrTableMutex);
-  m_brokerAddrTable.clear();
+  std::lock_guard<std::mutex> lock(broker_addr_table_mutex_);
+  broker_addr_table_.clear();
 }
 
 MQClientInstance::BrokerAddrMAP MQClientInstance::getBrokerAddrTable() {
-  std::lock_guard<std::mutex> lock(m_brokerAddrTableMutex);
-  return m_brokerAddrTable;
+  std::lock_guard<std::mutex> lock(broker_addr_table_mutex_);
+  return broker_addr_table_;
 }
 
 }  // namespace rocketmq
diff --git a/src/MQClientInstance.h b/src/MQClientInstance.h
index 77ee4b6..dc583ef 100644
--- a/src/MQClientInstance.h
+++ b/src/MQClientInstance.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_INSTANCE_H__
-#define __MQ_CLIENT_INSTANCE_H__
+#ifndef ROCKETMQ_MQCLIENTINSTANCE_H_
+#define ROCKETMQ_MQCLIENTINSTANCE_H_
 
 #include <memory>
 #include <mutex>
@@ -23,16 +23,16 @@
 #include <utility>
 
 #include "ConsumerRunningInfo.h"
-#include "FindBrokerResult.h"
+#include "FindBrokerResult.hpp"
 #include "HeartbeatData.h"
 #include "MQClientConfig.h"
-#include "MQClientException.h"
+#include "MQException.h"
 #include "MQConsumerInner.h"
 #include "MQMessageQueue.h"
 #include "MQProducerInner.h"
 #include "ServiceState.h"
-#include "TopicPublishInfo.h"
-#include "TopicRouteData.h"
+#include "TopicPublishInfo.hpp"
+#include "TopicRouteData.hpp"
 #include "concurrent/executor.hpp"
 
 namespace rocketmq {
@@ -103,9 +103,9 @@ class MQClientInstance {
   TopicRouteDataPtr getTopicRouteData(const std::string& topic);
 
  public:
-  MQClientAPIImpl* getMQClientAPIImpl() const { return m_mqClientAPIImpl.get(); }
-  MQAdminImpl* getMQAdminImpl() const { return m_mqAdminImpl.get(); }
-  PullMessageService* getPullMessageService() const { return m_pullMessageService.get(); }
+  MQClientAPIImpl* getMQClientAPIImpl() const { return mq_client_api_impl_.get(); }
+  MQAdminImpl* getMQAdminImpl() const { return mq_admin_impl_.get(); }
+  PullMessageService* getPullMessageService() const { return pull_message_service_.get(); }
 
  private:
   typedef std::map<std::string, std::map<int, std::string>> BrokerAddrMAP;
@@ -164,50 +164,50 @@ class MQClientInstance {
   bool isTopicInfoValidInTable(const std::string& topic);
 
  private:
-  std::string m_clientId;
-  volatile ServiceState m_serviceState;
+  std::string client_id_;
+  volatile ServiceState service_state_;
 
   // group -> MQProducer
   typedef std::map<std::string, MQProducerInner*> MQPMAP;
-  MQPMAP m_producerTable;
-  std::mutex m_producerTableMutex;
+  MQPMAP producer_table_;
+  std::mutex producer_table_mutex_;
 
   // group -> MQConsumer
   typedef std::map<std::string, MQConsumerInner*> MQCMAP;
-  MQCMAP m_consumerTable;
-  std::mutex m_consumerTableMutex;
+  MQCMAP consumer_table_;
+  std::mutex consumer_table_mutex_;
 
   // Topic -> TopicRouteData
   typedef std::map<std::string, TopicRouteDataPtr> TRDMAP;
-  TRDMAP m_topicRouteTable;
-  std::mutex m_topicRouteTableMutex;
+  TRDMAP topic_route_table_;
+  std::mutex topic_route_table_mutex_;
 
   // brokerName -> [ brokerid : addr ]
-  BrokerAddrMAP m_brokerAddrTable;
-  std::mutex m_brokerAddrTableMutex;
+  BrokerAddrMAP broker_addr_table_;
+  std::mutex broker_addr_table_mutex_;
 
   // topic -> TopicPublishInfo
   typedef std::map<std::string, TopicPublishInfoPtr> TPMAP;
-  TPMAP m_topicPublishInfoTable;
-  std::mutex m_topicPublishInfoTableMutex;
+  TPMAP topic_publish_info_table_;
+  std::mutex topic_publish_info_table_mutex_;
 
   // topic -> <broker, time>
   typedef std::map<std::string, std::pair<std::string, uint64_t>> TBAMAP;
-  TBAMAP m_topicBrokerAddrTable;
-  std::mutex m_topicBrokerAddrTableMutex;
+  TBAMAP topic_broker_addr_table_;
+  std::mutex topic_broker_addr_table_mutex_;
 
-  std::timed_mutex m_lockNamesrv;
-  std::timed_mutex m_lockHeartbeat;
+  std::timed_mutex lock_namesrv_;
+  std::timed_mutex lock_heartbeat_;
 
-  std::unique_ptr<MQClientAPIImpl> m_mqClientAPIImpl;
-  std::unique_ptr<MQAdminImpl> m_mqAdminImpl;
-  std::unique_ptr<ClientRemotingProcessor> m_clientRemotingProcessor;
+  std::unique_ptr<MQClientAPIImpl> mq_client_api_impl_;
+  std::unique_ptr<MQAdminImpl> mq_admin_impl_;
+  std::unique_ptr<ClientRemotingProcessor> client_remoting_processor_;
 
-  std::unique_ptr<RebalanceService> m_rebalanceService;
-  std::unique_ptr<PullMessageService> m_pullMessageService;
-  scheduled_thread_pool_executor m_scheduledExecutorService;
+  std::unique_ptr<RebalanceService> rebalance_service_;
+  std::unique_ptr<PullMessageService> pull_message_service_;
+  scheduled_thread_pool_executor scheduled_executor_service_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_INSTANCE_H__
+#endif  // ROCKETMQ_MQCLIENTINSTANCE_H_
diff --git a/src/MQClientManager.cpp b/src/MQClientManager.cpp
index a0b0fac..49fb19e 100644
--- a/src/MQClientManager.cpp
+++ b/src/MQClientManager.cpp
@@ -35,24 +35,24 @@ MQClientInstancePtr MQClientManager::getOrCreateMQClientInstance(const MQClientC
 MQClientInstancePtr MQClientManager::getOrCreateMQClientInstance(const MQClientConfig& clientConfig,
                                                                  RPCHookPtr rpcHook) {
   std::string clientId = clientConfig.buildMQClientId();
-  std::lock_guard<std::mutex> lock(m_mutex);
-  const auto& it = m_instanceTable.find(clientId);
-  if (it != m_instanceTable.end()) {
+  std::lock_guard<std::mutex> lock(mutex_);
+  const auto& it = instance_table_.find(clientId);
+  if (it != instance_table_.end()) {
     return it->second;
   } else {
     // Clone clientConfig in Java, but we don't now.
     auto instance = std::make_shared<MQClientInstance>(clientConfig, clientId, rpcHook);
-    m_instanceTable[clientId] = instance;
+    instance_table_[clientId] = instance;
     LOG_INFO_NEW("Created new MQClientInstance for clientId:[{}]", clientId);
     return instance;
   }
 }
 
 void MQClientManager::removeMQClientInstance(const std::string& clientId) {
-  std::lock_guard<std::mutex> lock(m_mutex);
-  const auto& it = m_instanceTable.find(clientId);
-  if (it != m_instanceTable.end()) {
-    m_instanceTable.erase(it);
+  std::lock_guard<std::mutex> lock(mutex_);
+  const auto& it = instance_table_.find(clientId);
+  if (it != instance_table_.end()) {
+    instance_table_.erase(it);
   }
 }
 
diff --git a/src/MQClientManager.h b/src/MQClientManager.h
index 7ecec15..4327b60 100644
--- a/src/MQClientManager.h
+++ b/src/MQClientManager.h
@@ -14,12 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CLIENT_MANAGER_H__
-#define __MQ_CLIENT_MANAGER_H__
+#ifndef ROCKETMQ_MQCLIENTMANAGER_H_
+#define ROCKETMQ_MQCLIENTMANAGER_H_
 
-#include <map>
-#include <memory>
-#include <string>
+#include <map>     // std::map
+#include <string>  // std::string
 
 #include "MQClientInstance.h"
 
@@ -40,10 +39,10 @@ class MQClientManager {
   MQClientManager();
 
  private:
-  std::map<std::string, MQClientInstancePtr> m_instanceTable;
-  std::mutex m_mutex;
+  std::map<std::string, MQClientInstancePtr> instance_table_;
+  std::mutex mutex_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CLIENT_MANAGER_H__
+#endif  // ROCKETMQ_MQCLIENTMANAGER_H_
diff --git a/src/common/ClientErrorCode.h b/src/common/ClientErrorCode.h
index d43e90f..dd60d79 100644
--- a/src/common/ClientErrorCode.h
+++ b/src/common/ClientErrorCode.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __CLIENT_ERROR_CODE_H__
-#define __CLIENT_ERROR_CODE_H__
+#ifndef ROCKETMQ_COMMON_CLIENTERRORCODE_H_
+#define ROCKETMQ_COMMON_CLIENTERRORCODE_H_
 
 namespace rocketmq {
 
@@ -32,4 +32,4 @@ class ClientErrorCode {
 
 }  // namespace rocketmq
 
-#endif  // __CLIENT_ERROR_CODE_H__
+#endif  // ROCKETMQ_COMMON_CLIENTERRORCODE_H_
diff --git a/src/common/ClientRPCHook.cpp b/src/common/ClientRPCHook.cpp
index 6c34852..5fcb47b 100644
--- a/src/common/ClientRPCHook.cpp
+++ b/src/common/ClientRPCHook.cpp
@@ -16,20 +16,18 @@
  */
 #include "ClientRPCHook.h"
 
-#include <string>
-
 #include "Logging.h"
 #include "RemotingCommand.h"
 #include "protocol/header/CommandHeader.h"
 #include "spas_client.h"
 
-namespace rocketmq {
+static const std::string ACCESS_KEY = "AccessKey";
+static const std::string SECRET_KEY = "SecretKey";
+static const std::string SIGNATURE_KEY = "Signature";
+static const std::string SIGNATURE_METHOD = "SignatureMethod";
+static const std::string ONS_CHANNEL_KEY = "OnsChannel";
 
-const std::string SessionCredentials::AccessKey = "AccessKey";
-const std::string SessionCredentials::SecretKey = "SecretKey";
-const std::string SessionCredentials::Signature = "Signature";
-const std::string SessionCredentials::SignatureMethod = "SignatureMethod";
-const std::string SessionCredentials::ONSChannelKey = "OnsChannel";
+namespace rocketmq {
 
 void ClientRPCHook::doBeforeRequest(const std::string& remoteAddr, RemotingCommand& request, bool toSent) {
   if (toSent) {
@@ -50,8 +48,8 @@ void ClientRPCHook::doAfterResponse(const std::string& remoteAddr,
 
 void ClientRPCHook::signCommand(RemotingCommand& command) {
   std::map<std::string, std::string> headerMap;
-  headerMap.insert(std::make_pair(SessionCredentials::AccessKey, session_credentials_.getAccessKey()));
-  headerMap.insert(std::make_pair(SessionCredentials::ONSChannelKey, session_credentials_.getAuthChannel()));
+  headerMap.insert(std::make_pair(ACCESS_KEY, session_credentials_.getAccessKey()));
+  headerMap.insert(std::make_pair(ONS_CHANNEL_KEY, session_credentials_.getAuthChannel()));
 
   LOG_DEBUG_NEW("before insert declared filed, MAP SIZE is:{}", headerMap.size());
   auto* header = command.readCustomHeader();
@@ -75,9 +73,9 @@ void ClientRPCHook::signCommand(RemotingCommand& command) {
       rocketmqSignature::spas_sign(totalMsg.c_str(), totalMsg.size(), session_credentials_.getSecretKey().c_str());
   if (sign != nullptr) {
     std::string signature(static_cast<const char*>(sign));
-    command.set_ext_field(SessionCredentials::Signature, signature);
-    command.set_ext_field(SessionCredentials::AccessKey, session_credentials_.getAccessKey());
-    command.set_ext_field(SessionCredentials::ONSChannelKey, session_credentials_.getAuthChannel());
+    command.set_ext_field(SIGNATURE_KEY, signature);
+    command.set_ext_field(ACCESS_KEY, session_credentials_.getAccessKey());
+    command.set_ext_field(ONS_CHANNEL_KEY, session_credentials_.getAuthChannel());
     rocketmqSignature::spas_mem_free(sign);
   } else {
     LOG_ERROR_NEW("signature for request failed");
diff --git a/src/common/FilterAPI.h b/src/common/FilterAPI.hpp
similarity index 74%
rename from src/common/FilterAPI.h
rename to src/common/FilterAPI.hpp
index 3ca8b31..aa40eb5 100644
--- a/src/common/FilterAPI.h
+++ b/src/common/FilterAPI.hpp
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __FILTER_API_H__
-#define __FILTER_API_H__
+#ifndef ROCKETMQ_COMMON_FILTERAPI_HPP_
+#define ROCKETMQ_COMMON_FILTERAPI_HPP_
 
-#include <string>
+#include <string>  // std::string
 
-#include "MQClientException.h"
+#include "MQException.h"
 #include "SubscriptionData.h"
 #include "UtilAll.h"
 
@@ -27,12 +27,12 @@ namespace rocketmq {
 
 class FilterAPI {
  public:
-  static SubscriptionDataPtr buildSubscriptionData(const std::string& topic, const std::string& subString) {
+  static SubscriptionData* buildSubscriptionData(const std::string& topic, const std::string& subString) {
     // delete in Rebalance
     std::unique_ptr<SubscriptionData> subscriptionData(new SubscriptionData(topic, subString));
 
-    if (subString.empty() || !subString.compare(SUB_ALL)) {
-      subscriptionData->setSubString(SUB_ALL);
+    if (subString.empty() || SUB_ALL == subString) {
+      subscriptionData->set_sub_string(SUB_ALL);
     } else {
       std::vector<std::string> tags;
       UtilAll::Split(tags, subString, "||");
@@ -42,8 +42,8 @@ class FilterAPI {
           if (!tag.empty()) {
             UtilAll::Trim(tag);
             if (!tag.empty()) {
-              subscriptionData->putTagsSet(tag);
-              subscriptionData->putCodeSet(UtilAll::hash_code(tag));
+              subscriptionData->put_tag(tag);
+              subscriptionData->put_code(UtilAll::hash_code(tag));
             }
           }
         }
@@ -58,4 +58,4 @@ class FilterAPI {
 
 }  // namespace rocketmq
 
-#endif  // __FILTER_API_H__
+#endif  // ROCKETMQ_COMMON_FILTERAPI_HPP_
diff --git a/src/common/InvokeCallback.h b/src/common/InvokeCallback.h
index 6762227..a89580f 100644
--- a/src/common/InvokeCallback.h
+++ b/src/common/InvokeCallback.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __INVOKE_CALLBACK_H__
-#define __INVOKE_CALLBACK_H__
+#ifndef ROCKETMQ_COMMON_INVOKECALLBACK_H_
+#define ROCKETMQ_COMMON_INVOKECALLBACK_H_
 
 namespace rocketmq {
 
@@ -24,9 +24,10 @@ class ResponseFuture;
 class InvokeCallback {
  public:
   virtual ~InvokeCallback() = default;
+
   virtual void operationComplete(ResponseFuture* responseFuture) noexcept = 0;
 };
 
 }  // namespace rocketmq
 
-#endif  // __INVOKE_CALLBACK_H__
+#endif  // ROCKETMQ_COMMON_INVOKECALLBACK_H_
diff --git a/src/common/MQVersion.cpp b/src/common/MQVersion.cpp
index 1d8e481..a5f027f 100644
--- a/src/common/MQVersion.cpp
+++ b/src/common/MQVersion.cpp
@@ -18,8 +18,8 @@
 
 namespace rocketmq {
 
-const int MQVersion::s_CurrentVersion = MQVersion::V4_6_0;
-const std::string MQVersion::s_CurrentLanguage = "CPP";
+const int MQVersion::CURRENT_VERSION = MQVersion::V4_6_0;
+const std::string MQVersion::CURRENT_LANGUAGE = "CPP";
 
 const char* MQVersion::GetVersionDesc(int value) {
   int currentVersion = value;
diff --git a/src/common/MQVersion.h b/src/common/MQVersion.h
index 2760dad..ec39c28 100644
--- a/src/common/MQVersion.h
+++ b/src/common/MQVersion.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_VERSION_H__
-#define __MQ_VERSION_H__
+#ifndef ROCKETMQ_COMMON_MQVERSION_H_
+#define ROCKETMQ_COMMON_MQVERSION_H_
 
 #include <string>
 
@@ -968,12 +968,12 @@ class MQVersion {
     HIGHER_VERSION
   };
 
-  static const int s_CurrentVersion;
-  static const std::string s_CurrentLanguage;
+  static const int CURRENT_VERSION;
+  static const std::string CURRENT_LANGUAGE;
 
   static const char* GetVersionDesc(int value);
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_VERSION_H__
+#endif  // ROCKETMQ_COMMON_MQVERSION_H_
diff --git a/src/common/MessageSysFlag.h b/src/common/MessageSysFlag.h
index 6948e37..07d6d37 100644
--- a/src/common/MessageSysFlag.h
+++ b/src/common/MessageSysFlag.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MESSAGE_SYS_FLAG_H__
-#define __MESSAGE_SYS_FLAG_H__
+#ifndef ROCKETMQ_COMMON_MESSAGESYSFLAG_H_
+#define ROCKETMQ_COMMON_MESSAGESYSFLAG_H_
 
 namespace rocketmq {
 
@@ -41,4 +41,4 @@ class MessageSysFlag {
 
 }  // namespace rocketmq
 
-#endif  // __MESSAGE_SYS_FLAG_H__
+#endif  // ROCKETMQ_COMMON_MESSAGESYSFLAG_H_
diff --git a/src/common/NameSpaceUtil.h b/src/common/NameSpaceUtil.h
index 29dfbb6..2e19c0a 100644
--- a/src/common/NameSpaceUtil.h
+++ b/src/common/NameSpaceUtil.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __NAMESPACE_UTIL_H__
-#define __NAMESPACE_UTIL_H__
+#ifndef ROCKETMQ_COMMON_NAMESPACEUTIL_H_
+#define ROCKETMQ_COMMON_NAMESPACEUTIL_H_
 
 #include <string>
 
@@ -33,4 +33,4 @@ class NameSpaceUtil {
 
 }  // namespace rocketmq
 
-#endif  // __NAMESPACE_UTIL_H__
+#endif  // ROCKETMQ_COMMON_NAMESPACEUTIL_H_
diff --git a/src/common/NamesrvConfig.h b/src/common/NamesrvConfig.h
deleted file mode 100644
index e74a6b3..0000000
--- a/src/common/NamesrvConfig.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __NAMESRV_CONFIG_H__
-#define __NAMESRV_CONFIG_H__
-
-#include <string>
-
-#include "UtilAll.h"
-
-namespace rocketmq {
-
-class NamesrvConfig {
- public:
-  NamesrvConfig() {
-    char* home = std::getenv(ROCKETMQ_HOME_ENV.c_str());
-    if (home != nullptr) {
-      m_rocketmqHome = home;
-    }
-  }
-
-  const std::string& getRocketmqHome() const { return m_rocketmqHome; }
-
-  void setRocketmqHome(const std::string& rocketmqHome) { m_rocketmqHome = rocketmqHome; }
-
-  const std::string& getKvConfigPath() const { return m_kvConfigPath; }
-
-  void setKvConfigPath(const std::string& kvConfigPath) { m_kvConfigPath = kvConfigPath; }
-
- private:
-  std::string m_rocketmqHome;
-  std::string m_kvConfigPath;
-};
-
-}  // namespace rocketmq
-
-#endif  // __NAMESRV_CONFIG_H__
diff --git a/src/common/PermName.h b/src/common/PermName.h
index e5ea3c6..9df10df 100644
--- a/src/common/PermName.h
+++ b/src/common/PermName.h
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PERM_NAME_H__
-#define __PERM_NAME_H__
+#ifndef ROCKETMQ_COMMON_PERMNAME_H_
+#define ROCKETMQ_COMMON_PERMNAME_H_
 
-#include <string>
+#include <string>  // std::string
 
 namespace rocketmq {
 
@@ -28,6 +28,7 @@ class PermName {
   static int PERM_WRITE;
   static int PERM_INHERIT;
 
+ public:
   static bool isReadable(int perm);
   static bool isWriteable(int perm);
   static bool isInherited(int perm);
@@ -36,4 +37,4 @@ class PermName {
 
 }  // namespace rocketmq
 
-#endif  // __PERM_NAME_H__
+#endif  // ROCKETMQ_COMMON_PERMNAME_H_
diff --git a/src/common/PullCallbackWrap.cpp b/src/common/PullCallbackWrap.cpp
index 32c2a58..65cf63c 100755
--- a/src/common/PullCallbackWrap.cpp
+++ b/src/common/PullCallbackWrap.cpp
@@ -19,27 +19,27 @@
 namespace rocketmq {
 
 PullCallbackWrap::PullCallbackWrap(PullCallback* pullCallback, MQClientAPIImpl* pClientAPI)
-    : m_pullCallback(pullCallback), m_pClientAPI(pClientAPI) {}
+    : pull_callback_(pullCallback), client_api_impl_(pClientAPI) {}
 
 void PullCallbackWrap::operationComplete(ResponseFuture* responseFuture) noexcept {
   std::unique_ptr<RemotingCommand> response(responseFuture->getResponseCommand());  // avoid RemotingCommand leak
 
-  if (m_pullCallback == nullptr) {
+  if (pull_callback_ == nullptr) {
     LOG_ERROR("m_pullCallback is NULL, AsyncPull could not continue");
     return;
   }
 
   if (response != nullptr) {
     try {
-      std::unique_ptr<PullResult> pullResult(m_pClientAPI->processPullResponse(response.get()));
+      std::unique_ptr<PullResult> pullResult(client_api_impl_->processPullResponse(response.get()));
       assert(pullResult != nullptr);
-      m_pullCallback->onSuccess(*pullResult);
+      pull_callback_->onSuccess(*pullResult);
     } catch (MQException& e) {
-      m_pullCallback->onException(e);
+      pull_callback_->onException(e);
     }
   } else {
     std::string err;
-    if (!responseFuture->isSendRequestOK()) {
+    if (!responseFuture->send_request_ok()) {
       err = "send request failed";
     } else if (responseFuture->isTimeout()) {
       err = "wait response timeout";
@@ -47,12 +47,12 @@ void PullCallbackWrap::operationComplete(ResponseFuture* responseFuture) noexcep
       err = "unknown reason";
     }
     MQException exception(err, -1, __FILE__, __LINE__);
-    m_pullCallback->onException(exception);
+    pull_callback_->onException(exception);
   }
 
   // auto delete callback
-  if (m_pullCallback->getPullCallbackType() == PULL_CALLBACK_TYPE_AUTO_DELETE) {
-    deleteAndZero(m_pullCallback);
+  if (pull_callback_->getPullCallbackType() == PULL_CALLBACK_TYPE_AUTO_DELETE) {
+    deleteAndZero(pull_callback_);
   }
 }
 
diff --git a/src/common/PullCallbackWrap.h b/src/common/PullCallbackWrap.h
index b4343d5..f676fe2 100755
--- a/src/common/PullCallbackWrap.h
+++ b/src/common/PullCallbackWrap.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PULL_CALLBACK_WRAP_H__
-#define __PULL_CALLBACK_WRAP_H__
+#ifndef ROCKET_COMMON_PULLCALLBACKWRAP_H_
+#define ROCKET_COMMON_PULLCALLBACKWRAP_H_
 
 #include "InvokeCallback.h"
 #include "MQClientAPIImpl.h"
@@ -31,10 +31,10 @@ class PullCallbackWrap : public InvokeCallback {
   void operationComplete(ResponseFuture* responseFuture) noexcept override;
 
  private:
-  PullCallback* m_pullCallback;
-  MQClientAPIImpl* m_pClientAPI;
+  PullCallback* pull_callback_;
+  MQClientAPIImpl* client_api_impl_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __PULL_CALLBACK_WRAP_H__
+#endif  // ROCKET_COMMON_PULLCALLBACKWRAP_H_
diff --git a/src/common/PullSysFlag.cpp b/src/common/PullSysFlag.cpp
index da6287f..dc8194f 100644
--- a/src/common/PullSysFlag.cpp
+++ b/src/common/PullSysFlag.cpp
@@ -16,12 +16,12 @@
  */
 #include "PullSysFlag.h"
 
-namespace rocketmq {
+static const int FLAG_COMMIT_OFFSET = 0x1 << 0;
+static const int FLAG_SUSPEND = 0x1 << 1;
+static const int FLAG_SUBSCRIPTION = 0x1 << 2;
+static const int FLAG_CLASS_FILTER = 0x1 << 3;
 
-int PullSysFlag::FLAG_COMMIT_OFFSET = 0x1 << 0;
-int PullSysFlag::FLAG_SUSPEND = 0x1 << 1;
-int PullSysFlag::FLAG_SUBSCRIPTION = 0x1 << 2;
-int PullSysFlag::FLAG_CLASS_FILTER = 0x1 << 3;
+namespace rocketmq {
 
 int PullSysFlag::buildSysFlag(bool commitOffset, bool suspend, bool subscription, bool classFilter) {
   int flag = 0;
diff --git a/src/common/PullSysFlag.h b/src/common/PullSysFlag.h
index 3e2cac2..51f2944 100644
--- a/src/common/PullSysFlag.h
+++ b/src/common/PullSysFlag.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PULL_SYS_FLAG_H__
-#define __PULL_SYS_FLAG_H__
+#ifndef ROCKETMQ_COMMON_PULLSYSFLAG_H_
+#define ROCKETMQ_COMMON_PULLSYSFLAG_H_
 
 namespace rocketmq {
 
@@ -28,14 +28,8 @@ class PullSysFlag {
   static bool hasSuspendFlag(int sysFlag);
   static bool hasSubscriptionFlag(int sysFlag);
   static bool hasClassFilterFlag(int sysFlag);
-
- private:
-  static int FLAG_COMMIT_OFFSET;
-  static int FLAG_SUSPEND;
-  static int FLAG_SUBSCRIPTION;
-  static int FLAG_CLASS_FILTER;
 };
 
 }  // namespace rocketmq
 
-#endif  // __PULL_SYS_FLAG_H__
+#endif  // ROCKETMQ_COMMON_PULLSYSFLAG_H_
diff --git a/src/common/SendCallbackWrap.cpp b/src/common/SendCallbackWrap.cpp
index e8951b3..d7514c0 100755
--- a/src/common/SendCallbackWrap.cpp
+++ b/src/common/SendCallbackWrap.cpp
@@ -26,8 +26,8 @@
 #include "MQMessageQueue.h"
 #include "MQProtos.h"
 #include "PullAPIWrapper.h"
-#include "PullResultExt.h"
-#include "TopicPublishInfo.h"
+#include "PullResultExt.hpp"
+#include "TopicPublishInfo.hpp"
 #include "protocol/header/CommandHeader.h"
 
 namespace rocketmq {
@@ -42,32 +42,32 @@ SendCallbackWrap::SendCallbackWrap(const std::string& addr,
                                    int retryTimesWhenSendFailed,
                                    int times,
                                    DefaultMQProducerImplPtr producer)
-    : m_addr(addr),
-      m_brokerName(brokerName),
-      m_msg(msg),
-      m_request(std::forward<RemotingCommand>(request)),
-      m_sendCallback(sendCallback),
-      m_topicPublishInfo(topicPublishInfo),
-      m_instance(instance),
-      m_timesTotal(retryTimesWhenSendFailed),
-      m_times(times),
-      m_producer(producer) {}
+    : addr_(addr),
+      broker_name_(brokerName),
+      msg_(msg),
+      request_(std::forward<RemotingCommand>(request)),
+      send_callback_(sendCallback),
+      topic_publish_info_(topicPublishInfo),
+      instance_(instance),
+      times_total_(retryTimesWhenSendFailed),
+      times_(times),
+      producer_(producer) {}
 
 void SendCallbackWrap::operationComplete(ResponseFuture* responseFuture) noexcept {
-  auto producer = m_producer.lock();
+  auto producer = producer_.lock();
   if (nullptr == producer) {
     MQException exception("DefaultMQProducer is released.", -1, __FILE__, __LINE__);
-    m_sendCallback->onException(exception);
+    send_callback_->onException(exception);
 
     // auto delete callback
-    if (m_sendCallback->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
-      deleteAndZero(m_sendCallback);
+    if (send_callback_->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
+      deleteAndZero(send_callback_);
     }
     return;
   }
 
   std::unique_ptr<RemotingCommand> response(responseFuture->getResponseCommand());  // avoid RemotingCommand leak
-  if (nullptr == m_sendCallback && response != nullptr) {
+  if (nullptr == send_callback_ && response != nullptr) {
     // TODO: executeSendMessageHookAfter
     // try {
     //   std::unique_ptr<SendResult> sendResult(m_pClientAPI->processSendResponse(m_brokerName, m_msg, response.get()));
@@ -78,19 +78,19 @@ void SendCallbackWrap::operationComplete(ResponseFuture* responseFuture) noexcep
     // } catch (...) {
     // }
 
-    producer->updateFaultItem(m_brokerName, UtilAll::currentTimeMillis() - responseFuture->getBeginTimestamp(), false);
+    producer->updateFaultItem(broker_name_, UtilAll::currentTimeMillis() - responseFuture->begin_timestamp(), false);
     return;
   }
 
   if (response != nullptr) {
-    int opaque = responseFuture->getOpaque();
+    int opaque = responseFuture->opaque();
     try {
       std::unique_ptr<SendResult> sendResult(
-          m_instance->getMQClientAPIImpl()->processSendResponse(m_brokerName, m_msg, response.get()));
+          instance_->getMQClientAPIImpl()->processSendResponse(broker_name_, msg_, response.get()));
       assert(sendResult != nullptr);
 
       LOG_DEBUG("operationComplete: processSendResponse success, opaque:%d, maxRetryTime:%d, retrySendTimes:%d", opaque,
-                m_timesTotal, m_times);
+                times_total_, times_);
 
       // TODO: executeSendMessageHookAfter
       // if (context != null) {
@@ -99,26 +99,25 @@ void SendCallbackWrap::operationComplete(ResponseFuture* responseFuture) noexcep
       // }
 
       try {
-        m_sendCallback->onSuccess(*sendResult);
+        send_callback_->onSuccess(*sendResult);
       } catch (...) {
       }
 
-      producer->updateFaultItem(m_brokerName, UtilAll::currentTimeMillis() - responseFuture->getBeginTimestamp(),
-                                false);
+      producer->updateFaultItem(broker_name_, UtilAll::currentTimeMillis() - responseFuture->begin_timestamp(), false);
 
       // auto delete callback
-      if (m_sendCallback->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
-        deleteAndZero(m_sendCallback);
+      if (send_callback_->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
+        deleteAndZero(send_callback_);
       }
     } catch (MQException& e) {
-      producer->updateFaultItem(m_brokerName, UtilAll::currentTimeMillis() - responseFuture->getBeginTimestamp(), true);
+      producer->updateFaultItem(broker_name_, UtilAll::currentTimeMillis() - responseFuture->begin_timestamp(), true);
       LOG_ERROR("operationComplete: processSendResponse exception: %s", e.what());
       return onExceptionImpl(responseFuture, responseFuture->leftTime(), e, false);
     }
   } else {
-    producer->updateFaultItem(m_brokerName, UtilAll::currentTimeMillis() - responseFuture->getBeginTimestamp(), true);
+    producer->updateFaultItem(broker_name_, UtilAll::currentTimeMillis() - responseFuture->begin_timestamp(), true);
     std::string err;
-    if (!responseFuture->isSendRequestOK()) {
+    if (!responseFuture->send_request_ok()) {
       err = "send request failed";
     } else if (responseFuture->isTimeout()) {
       err = "wait response timeout";
@@ -134,58 +133,58 @@ void SendCallbackWrap::onExceptionImpl(ResponseFuture* responseFuture,
                                        long timeoutMillis,
                                        MQException& e,
                                        bool needRetry) {
-  auto producer = m_producer.lock();
+  auto producer = producer_.lock();
   if (nullptr == producer) {
     MQException exception("DefaultMQProducer is released.", -1, __FILE__, __LINE__);
-    m_sendCallback->onException(exception);
+    send_callback_->onException(exception);
 
     // auto delete callback
-    if (m_sendCallback->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
-      deleteAndZero(m_sendCallback);
+    if (send_callback_->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
+      deleteAndZero(send_callback_);
     }
     return;
   }
 
-  m_times++;
-  if (needRetry && m_times <= m_timesTotal) {
-    std::string retryBrokerName = m_brokerName;  // by default, it will send to the same broker
-    if (m_topicPublishInfo != nullptr) {
+  times_++;
+  if (needRetry && times_ <= times_total_) {
+    std::string retryBrokerName = broker_name_;  // by default, it will send to the same broker
+    if (topic_publish_info_ != nullptr) {
       // select one message queue accordingly, in order to determine which broker to send
-      const auto& mqChosen = producer->selectOneMessageQueue(m_topicPublishInfo.get(), m_brokerName);
-      retryBrokerName = mqChosen.getBrokerName();
+      const auto& mqChosen = producer->selectOneMessageQueue(topic_publish_info_.get(), broker_name_);
+      retryBrokerName = mqChosen.broker_name();
 
       // set queueId to requestHeader
-      auto* requestHeader = m_request.readCustomHeader();
+      auto* requestHeader = request_.readCustomHeader();
       if (std::type_index(typeid(*requestHeader)) == std::type_index(typeid(SendMessageRequestHeaderV2))) {
-        static_cast<SendMessageRequestHeaderV2*>(requestHeader)->e = mqChosen.getQueueId();
+        static_cast<SendMessageRequestHeaderV2*>(requestHeader)->e = mqChosen.queue_id();
       } else {
-        static_cast<SendMessageRequestHeader*>(requestHeader)->queueId = mqChosen.getQueueId();
+        static_cast<SendMessageRequestHeader*>(requestHeader)->queueId = mqChosen.queue_id();
       }
     }
-    std::string addr = m_instance->findBrokerAddressInPublish(retryBrokerName);
-    LOG_INFO_NEW("async send msg by retry {} times. topic={}, brokerAddr={}, brokerName={}", m_times, m_msg->getTopic(),
+    std::string addr = instance_->findBrokerAddressInPublish(retryBrokerName);
+    LOG_INFO_NEW("async send msg by retry {} times. topic={}, brokerAddr={}, brokerName={}", times_, msg_->getTopic(),
                  addr, retryBrokerName);
     try {
       // new request
-      m_request.set_opaque(RemotingCommand::createNewRequestId());
+      request_.set_opaque(RemotingCommand::createNewRequestId());
 
       // resend
-      m_addr = std::move(addr);
-      m_brokerName = std::move(retryBrokerName);
-      m_instance->getMQClientAPIImpl()->sendMessageAsyncImpl(this, timeoutMillis);
+      addr_ = std::move(addr);
+      broker_name_ = std::move(retryBrokerName);
+      instance_->getMQClientAPIImpl()->sendMessageAsyncImpl(this, timeoutMillis);
 
       responseFuture->releaseInvokeCallback();  // for avoid delete this SendCallbackWrap
       return;
     } catch (MQException& e1) {
-      producer->updateFaultItem(m_brokerName, 3000, true);
+      producer->updateFaultItem(broker_name_, 3000, true);
       return onExceptionImpl(responseFuture, responseFuture->leftTime(), e1, true);
     }
   } else {
-    m_sendCallback->onException(e);
+    send_callback_->onException(e);
 
     // auto delete callback
-    if (m_sendCallback->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
-      deleteAndZero(m_sendCallback);
+    if (send_callback_->getSendCallbackType() == SEND_CALLBACK_TYPE_AUTO_DELETE) {
+      deleteAndZero(send_callback_);
     }
   }
 }
diff --git a/src/common/SendCallbackWrap.h b/src/common/SendCallbackWrap.h
index 2ef8ffa..5bf9f6f 100755
--- a/src/common/SendCallbackWrap.h
+++ b/src/common/SendCallbackWrap.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SEND_CALLBACK_WRAP_H__
-#define __SEND_CALLBACK_WRAP_H__
+#ifndef ROCKETMQ_COMMON_SENDCALLBACKWRAP_H_
+#define ROCKETMQ_COMMON_SENDCALLBACKWRAP_H_
 
 #include <functional>
 
@@ -26,7 +26,7 @@
 #include "RemotingCommand.h"
 #include "ResponseFuture.h"
 #include "SendCallback.h"
-#include "TopicPublishInfo.h"
+#include "TopicPublishInfo.hpp"
 
 namespace rocketmq {
 
@@ -46,27 +46,27 @@ class SendCallbackWrap : public InvokeCallback {
   void operationComplete(ResponseFuture* responseFuture) noexcept override;
   void onExceptionImpl(ResponseFuture* responseFuture, long timeoutMillis, MQException& e, bool needRetry);
 
-  const std::string& getAddr() { return m_addr; }
-  const MessagePtr getMessage() { return m_msg; }
-  RemotingCommand& getRemotingCommand() { return m_request; }
+  const std::string& getAddr() { return addr_; }
+  const MessagePtr getMessage() { return msg_; }
+  RemotingCommand& getRemotingCommand() { return request_; }
 
-  void setRetrySendTimes(int retrySendTimes) { m_times = retrySendTimes; }
-  int getRetrySendTimes() { return m_times; }
-  int getMaxRetrySendTimes() { return m_timesTotal; }
+  void setRetrySendTimes(int retrySendTimes) { times_ = retrySendTimes; }
+  int getRetrySendTimes() { return times_; }
+  int getMaxRetrySendTimes() { return times_total_; }
 
  private:
-  std::string m_addr;
-  std::string m_brokerName;
-  const MessagePtr m_msg;
-  RemotingCommand m_request;
-  SendCallback* m_sendCallback;
-  TopicPublishInfoPtr m_topicPublishInfo;
-  MQClientInstancePtr m_instance;
-  int m_timesTotal;
-  int m_times;
-  std::weak_ptr<DefaultMQProducerImpl> m_producer;
+  std::string addr_;
+  std::string broker_name_;
+  const MessagePtr msg_;
+  RemotingCommand request_;
+  SendCallback* send_callback_;
+  TopicPublishInfoPtr topic_publish_info_;
+  MQClientInstancePtr instance_;
+  int times_total_;
+  int times_;
+  std::weak_ptr<DefaultMQProducerImpl> producer_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __SEND_CALLBACK_WRAP_H__
+#endif  // ROCKETMQ_COMMON_SENDCALLBACKWRAP_H_
diff --git a/src/common/ServiceState.h b/src/common/ServiceState.h
index 726c150..d2fd31a 100644
--- a/src/common/ServiceState.h
+++ b/src/common/ServiceState.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SERVICE_STATE_H__
-#define __SERVICE_STATE_H__
+#ifndef ROCKETMQ_COMMON_SERVICESTATE_H_
+#define ROCKETMQ_COMMON_SERVICESTATE_H_
 
 namespace rocketmq {
 
@@ -23,4 +23,4 @@ enum ServiceState { CREATE_JUST, RUNNING, SHUTDOWN_ALREADY, START_FAILED };
 
 }  // namespace rocketmq
 
-#endif  // __SERVICE_STATE_H__
+#endif  // ROCKETMQ_COMMON_SERVICESTATE_H_
diff --git a/src/common/ServiceThread.cpp b/src/common/ServiceThread.cpp
index e778307..059a290 100644
--- a/src/common/ServiceThread.cpp
+++ b/src/common/ServiceThread.cpp
@@ -22,65 +22,65 @@
 namespace rocketmq {
 
 void ServiceThread::start() {
-  LOG_INFO_NEW("Try to start service thread:{} started:{} lastThread:{}", getServiceName(), m_started.load(),
-               (void*)m_thread.get());
+  LOG_INFO_NEW("Try to start service thread:{} started:{} lastThread:{}", getServiceName(), started_.load(),
+               (void*)thread_.get());
   bool expected = false;
-  if (!m_started.compare_exchange_strong(expected, true)) {
+  if (!started_.compare_exchange_strong(expected, true)) {
     return;
   }
-  m_stopped = false;
-  m_thread.reset(new thread(getServiceName(), &ServiceThread::run, this));
-  m_thread->start();
+  stopped_ = false;
+  thread_.reset(new thread(getServiceName(), &ServiceThread::run, this));
+  thread_->start();
 }
 
 void ServiceThread::shutdown() {
-  LOG_INFO_NEW("Try to shutdown service thread:{} started:{} lastThread:{}", getServiceName(), m_started.load(),
-               (void*)m_thread.get());
+  LOG_INFO_NEW("Try to shutdown service thread:{} started:{} lastThread:{}", getServiceName(), started_.load(),
+               (void*)thread_.get());
   bool expected = true;
-  if (!m_started.compare_exchange_strong(expected, false)) {
+  if (!started_.compare_exchange_strong(expected, false)) {
     return;
   }
-  m_stopped = true;
+  stopped_ = true;
   LOG_INFO_NEW("shutdown thread {}", getServiceName());
 
   wakeup();
 
   int64_t beginTime = UtilAll::currentTimeMillis();
-  m_thread->join();
+  thread_->join();
   int64_t elapsedTime = UtilAll::currentTimeMillis() - beginTime;
   LOG_INFO_NEW("join thread {} elapsed time(ms) {}", getServiceName(), elapsedTime);
 }
 
 void ServiceThread::wakeup() {
   bool expected = false;
-  if (m_hasNotified.compare_exchange_strong(expected, true)) {
-    m_waitPoint.count_down();  // notify
+  if (has_notified_.compare_exchange_strong(expected, true)) {
+    wait_point_.count_down();  // notify
   }
 }
 
 void ServiceThread::waitForRunning(long interval) {
   bool expected = true;
-  if (m_hasNotified.compare_exchange_strong(expected, false)) {
+  if (has_notified_.compare_exchange_strong(expected, false)) {
     onWaitEnd();
     return;
   }
 
   // entry to wait
-  m_waitPoint.reset();
+  wait_point_.reset();
 
   try {
-    m_waitPoint.wait(interval, time_unit::milliseconds);
+    wait_point_.wait(interval, time_unit::milliseconds);
   } catch (const std::exception& e) {
     LOG_WARN_NEW("encounter unexpected exception: {}", e.what());
   }
-  m_hasNotified.store(false);
+  has_notified_.store(false);
   onWaitEnd();
 }
 
 void ServiceThread::onWaitEnd() {}
 
 bool ServiceThread::isStopped() {
-  return m_stopped;
+  return stopped_;
 };
 
 }  // namespace rocketmq
diff --git a/src/common/ServiceThread.h b/src/common/ServiceThread.h
index ff65489..70591ac 100644
--- a/src/common/ServiceThread.h
+++ b/src/common/ServiceThread.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SERVICE_THREAD_H__
-#define __SERVICE_THREAD_H__
+#ifndef ROCKETMQ_COMMON_SERVICETHREAD_H_
+#define ROCKETMQ_COMMON_SERVICETHREAD_H_
 
 #include <atomic>
 #include <memory>
@@ -28,12 +28,7 @@ namespace rocketmq {
 class ServiceThread {
  public:
   ServiceThread()
-      : m_waitPoint(1),
-        m_hasNotified(false),
-        m_stopped(false),
-        m_isDaemon(false),
-        m_thread(nullptr),
-        m_started(false) {}
+      : wait_point_(1), has_notified_(false), stopped_(false), is_daemon_(false), thread_(nullptr), started_(false) {}
   virtual ~ServiceThread() = default;
 
   virtual std::string getServiceName() = 0;
@@ -51,16 +46,16 @@ class ServiceThread {
   virtual void onWaitEnd();
 
  protected:
-  latch m_waitPoint;
-  std::atomic<bool> m_hasNotified;
-  volatile bool m_stopped;
-  bool m_isDaemon;
+  latch wait_point_;
+  std::atomic<bool> has_notified_;
+  volatile bool stopped_;
+  bool is_daemon_;
 
  private:
-  std::unique_ptr<thread> m_thread;
-  std::atomic<bool> m_started;
+  std::unique_ptr<thread> thread_;
+  std::atomic<bool> started_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __PULL_MESSAGE_SERVICE_H__
+#endif  // ROCKETMQ_COMMON_SERVICETHREAD_H_
diff --git a/src/common/SubscriptionData.h b/src/common/SubscriptionData.h
index 9db58d9..277403c 100644
--- a/src/common/SubscriptionData.h
+++ b/src/common/SubscriptionData.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SUBSCRIPTION_DATA_H__
-#define __SUBSCRIPTION_DATA_H__
+#ifndef ROCKETMQ_SUBSCRIPTIONDATA_H_
+#define ROCKETMQ_SUBSCRIPTIONDATA_H_
 
 #include <json/json.h>
 
@@ -26,48 +26,47 @@
 
 namespace rocketmq {
 
-class SubscriptionData;
-typedef SubscriptionData* SubscriptionDataPtr;
-
 class ROCKETMQCLIENT_API SubscriptionData {
  public:
   SubscriptionData();
   SubscriptionData(const std::string& topic, const std::string& subString);
   SubscriptionData(const SubscriptionData& other);
 
-  virtual ~SubscriptionData() {
-    m_tagSet.clear();
-    m_codeSet.clear();
-  }
+  virtual ~SubscriptionData() = default;
+
+  bool operator==(const SubscriptionData& other) const;
+  bool operator!=(const SubscriptionData& other) const { return !operator==(other); }
+
+  bool operator<(const SubscriptionData& other) const;
 
-  const std::string& getTopic() const;
+  Json::Value toJson() const;
 
-  const std::string& getSubString() const;
-  void setSubString(const std::string& sub);
+ public:
+  inline const std::string& topic() const { return topic_; }
 
-  int64_t getSubVersion() const;
+  inline const std::string& sub_string() const { return sub_string_; }
+  inline void set_sub_string(const std::string& sub) { sub_string_ = sub; }
 
-  void putTagsSet(const std::string& tag);
-  bool containTag(const std::string& tag);
-  std::vector<std::string>& getTagsSet();
+  inline int64_t sub_version() const { return sub_version_; }
 
-  void putCodeSet(int32_t code);
+  inline std::vector<std::string>& tags_set() { return tag_set_; }
 
-  bool operator==(const SubscriptionData& other) const;
-  bool operator!=(const SubscriptionData& other) const { return !operator==(other); }
+  inline void put_tag(const std::string& tag) { tag_set_.push_back(tag); }
 
-  bool operator<(const SubscriptionData& other) const;
+  inline bool contain_tag(const std::string& tag) const {
+    return std::find(tag_set_.begin(), tag_set_.end(), tag) != tag_set_.end();
+  }
 
-  Json::Value toJson() const;
+  inline void put_code(int32_t code) { code_set_.push_back(code); }
 
  private:
-  std::string m_topic;
-  std::string m_subString;
-  int64_t m_subVersion;
-  std::vector<std::string> m_tagSet;
-  std::vector<int32_t> m_codeSet;
+  std::string topic_;
+  std::string sub_string_;
+  int64_t sub_version_;
+  std::vector<std::string> tag_set_;
+  std::vector<int32_t> code_set_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __SUBSCRIPTION_DATA_H__
+#endif  // ROCKETMQ_SUBSCRIPTIONDATA_H_
diff --git a/src/common/SubscriptionGroupConfig.h b/src/common/SubscriptionGroupConfig.h
index eec7ef2..2e39018 100644
--- a/src/common/SubscriptionGroupConfig.h
+++ b/src/common/SubscriptionGroupConfig.h
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __SUBSCRIPTION_GROUP_CONFIG_H__
-#define __SUBSCRIPTION_GROUP_CONFIG_H__
+#ifndef ROCKETMQ_COMMON_SUBSCRIPTIONGROUPCONFIG_H_
+#define ROCKETMQ_COMMON_SUBSCRIPTIONGROUPCONFIG_H_
 
-#include <string>
+#include "UtilAll.h"
 
 namespace rocketmq {
 
@@ -47,4 +47,4 @@ class SubscriptionGroupConfig {
 
 }  // namespace rocketmq
 
-#endif  // __SUBSCRIPTION_GROUP_CONFIG_H__
+#endif  // ROCKETMQ_COMMON_SUBSCRIPTIONGROUPCONFIG_H_
diff --git a/src/common/TopicConfig.cpp b/src/common/TopicConfig.cpp
index 3a7a196..a32edab 100644
--- a/src/common/TopicConfig.cpp
+++ b/src/common/TopicConfig.cpp
@@ -20,40 +20,41 @@
 
 #include "PermName.h"
 
+static const std::string SEPARATOR = " ";
+
 namespace rocketmq {
 
-int TopicConfig::DefaultReadQueueNums = 16;
-int TopicConfig::DefaultWriteQueueNums = 16;
-std::string TopicConfig::SEPARATOR = " ";
+const int TopicConfig::DEFAULT_READ_QUEUE_NUMS = 16;
+const int TopicConfig::DEFAULT_WRITE_QUEUE_NUMS = 16;
 
 TopicConfig::TopicConfig()
-    : m_topicName(""),
-      m_readQueueNums(DefaultReadQueueNums),
-      m_writeQueueNums(DefaultWriteQueueNums),
-      m_perm(PermName::PERM_READ | PermName::PERM_WRITE),
-      m_topicFilterType(SINGLE_TAG) {}
+    : topic_name_(null),
+      read_queue_nums_(DEFAULT_READ_QUEUE_NUMS),
+      write_queue_nums_(DEFAULT_WRITE_QUEUE_NUMS),
+      perm_(PermName::PERM_READ | PermName::PERM_WRITE),
+      topic_filter_type_(SINGLE_TAG) {}
 
 TopicConfig::TopicConfig(const std::string& topicName)
-    : m_topicName(topicName),
-      m_readQueueNums(DefaultReadQueueNums),
-      m_writeQueueNums(DefaultWriteQueueNums),
-      m_perm(PermName::PERM_READ | PermName::PERM_WRITE),
-      m_topicFilterType(SINGLE_TAG) {}
+    : topic_name_(topicName),
+      read_queue_nums_(DEFAULT_READ_QUEUE_NUMS),
+      write_queue_nums_(DEFAULT_WRITE_QUEUE_NUMS),
+      perm_(PermName::PERM_READ | PermName::PERM_WRITE),
+      topic_filter_type_(SINGLE_TAG) {}
 
 TopicConfig::TopicConfig(const std::string& topicName, int readQueueNums, int writeQueueNums, int perm)
-    : m_topicName(topicName),
-      m_readQueueNums(readQueueNums),
-      m_writeQueueNums(writeQueueNums),
-      m_perm(perm),
-      m_topicFilterType(SINGLE_TAG) {}
+    : topic_name_(topicName),
+      read_queue_nums_(readQueueNums),
+      write_queue_nums_(writeQueueNums),
+      perm_(perm),
+      topic_filter_type_(SINGLE_TAG) {}
 
 TopicConfig::~TopicConfig() {}
 
-std::string TopicConfig::encode() {
+std::string TopicConfig::encode() const {
   std::stringstream ss;
 
-  ss << m_topicName << SEPARATOR << m_readQueueNums << SEPARATOR << m_writeQueueNums << SEPARATOR << m_perm << SEPARATOR
-     << m_topicFilterType;
+  ss << topic_name_ << SEPARATOR << read_queue_nums_ << SEPARATOR << write_queue_nums_ << SEPARATOR << perm_
+     << SEPARATOR << topic_filter_type_;
 
   return ss.str();
 }
@@ -61,56 +62,16 @@ std::string TopicConfig::encode() {
 bool TopicConfig::decode(const std::string& in) {
   std::stringstream ss(in);
 
-  ss >> m_topicName;
-  ss >> m_readQueueNums;
-  ss >> m_writeQueueNums;
-  ss >> m_perm;
+  ss >> topic_name_;
+  ss >> read_queue_nums_;
+  ss >> write_queue_nums_;
+  ss >> perm_;
 
   int type;
   ss >> type;
-  m_topicFilterType = (TopicFilterType)type;
+  topic_filter_type_ = (TopicFilterType)type;
 
   return true;
 }
 
-const std::string& TopicConfig::getTopicName() {
-  return m_topicName;
-}
-
-void TopicConfig::setTopicName(const std::string& topicName) {
-  m_topicName = topicName;
-}
-
-int TopicConfig::getReadQueueNums() {
-  return m_readQueueNums;
-}
-
-void TopicConfig::setReadQueueNums(int readQueueNums) {
-  m_readQueueNums = readQueueNums;
-}
-
-int TopicConfig::getWriteQueueNums() {
-  return m_writeQueueNums;
-}
-
-void TopicConfig::setWriteQueueNums(int writeQueueNums) {
-  m_writeQueueNums = writeQueueNums;
-}
-
-int TopicConfig::getPerm() {
-  return m_perm;
-}
-
-void TopicConfig::setPerm(int perm) {
-  m_perm = perm;
-}
-
-TopicFilterType TopicConfig::getTopicFilterType() {
-  return m_topicFilterType;
-}
-
-void TopicConfig::setTopicFilterType(TopicFilterType topicFilterType) {
-  m_topicFilterType = topicFilterType;
-}
-
 }  // namespace rocketmq
diff --git a/src/common/TopicConfig.h b/src/common/TopicConfig.h
index fa796ef..9fba938 100644
--- a/src/common/TopicConfig.h
+++ b/src/common/TopicConfig.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __TOPIC_CONFIG_H__
-#define __TOPIC_CONFIG_H__
+#ifndef ROCKETMQ_COMMON_TOPICCONFIG_H_
+#define ROCKETMQ_COMMON_TOPICCONFIG_H_
 
 #include <string>
 
@@ -26,38 +26,42 @@ namespace rocketmq {
 
 class TopicConfig {
  public:
+  static const int DEFAULT_READ_QUEUE_NUMS;
+  static const int DEFAULT_WRITE_QUEUE_NUMS;
+
+ public:
   TopicConfig();
   TopicConfig(const std::string& topicName);
   TopicConfig(const std::string& topicName, int readQueueNums, int writeQueueNums, int perm);
   ~TopicConfig();
 
-  std::string encode();
+  std::string encode() const;
   bool decode(const std::string& in);
-  const std::string& getTopicName();
-  void setTopicName(const std::string& topicName);
-  int getReadQueueNums();
-  void setReadQueueNums(int readQueueNums);
-  int getWriteQueueNums();
-  void setWriteQueueNums(int writeQueueNums);
-  int getPerm();
-  void setPerm(int perm);
-  TopicFilterType getTopicFilterType();
-  void setTopicFilterType(TopicFilterType topicFilterType);
 
  public:
-  static int DefaultReadQueueNums;
-  static int DefaultWriteQueueNums;
+  inline const std::string& topic_name() const { return topic_name_; }
+  inline void set_topic_name(const std::string& topicName) { topic_name_ = topicName; }
 
- private:
-  static std::string SEPARATOR;
+  inline int read_queue_nums() const { return read_queue_nums_; }
+  inline void set_read_queue_nums(int readQueueNums) { read_queue_nums_ = readQueueNums; }
+
+  inline int write_queue_nums() const { return write_queue_nums_; }
+  inline void set_write_queue_nums(int writeQueueNums) { write_queue_nums_ = writeQueueNums; }
 
-  std::string m_topicName;
-  int m_readQueueNums;
-  int m_writeQueueNums;
-  int m_perm;
-  TopicFilterType m_topicFilterType;
+  inline int perm() const { return perm_; }
+  inline void set_perm(int perm) { perm_ = perm; }
+
+  inline TopicFilterType topic_filter_type() const { return topic_filter_type_; }
+  inline void set_topic_filter_type(TopicFilterType topicFilterType) { topic_filter_type_ = topicFilterType; }
+
+ private:
+  std::string topic_name_;
+  int read_queue_nums_;
+  int write_queue_nums_;
+  int perm_;
+  TopicFilterType topic_filter_type_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __TOPIC_CONFIG_H__
+#endif  // ROCKETMQ_COMMON_TOPICCONFIG_H_
diff --git a/src/common/UtilAll.cpp b/src/common/UtilAll.cpp
index 162a45e..f326d95 100644
--- a/src/common/UtilAll.cpp
+++ b/src/common/UtilAll.cpp
@@ -154,7 +154,7 @@ bool UtilAll::SplitURL(const std::string& serverURL, std::string& addr, short& n
   }
 
   addr = serverURL.substr(0, pos);
-  if (0 == addr.compare("localhost")) {
+  if ("localhost" == addr) {
     addr = "127.0.0.1";
   }
 
diff --git a/src/common/Validators.cpp b/src/common/Validators.cpp
index 9525a41..22084ee 100644
--- a/src/common/Validators.cpp
+++ b/src/common/Validators.cpp
@@ -19,12 +19,11 @@
 #include <regex>
 
 #include "MQProtos.h"
-#include "UtilAll.h"
 
-namespace rocketmq {
+const std::string VALID_PATTERN_STR = "^[a-zA-Z0-9_-]+$";
+const int CHARACTER_MAX_LENGTH = 255;
 
-const std::string Validators::validPatternStr = "^[a-zA-Z0-9_-]+$";
-const int Validators::CHARACTER_MAX_LENGTH = 255;
+namespace rocketmq {
 
 bool Validators::regularExpressionMatcher(const std::string& origin, const std::string& patternStr) {
   if (UtilAll::isBlank(origin)) {
@@ -75,8 +74,9 @@ void Validators::checkTopic(const std::string& topic) {
     THROW_MQEXCEPTION(MQClientException, "the topic[" + topic + "] is conflict with default topic.", -1);
   }
 
-  if (!regularExpressionMatcher(topic, validPatternStr)) {
-    std::string str = "the specified topic[" + topic + "] contains illegal characters, allowing only" + validPatternStr;
+  if (!regularExpressionMatcher(topic, VALID_PATTERN_STR)) {
+    std::string str =
+        "the specified topic[" + topic + "] contains illegal characters, allowing only" + VALID_PATTERN_STR;
     THROW_MQEXCEPTION(MQClientException, str, -1);
   }
 }
@@ -86,8 +86,9 @@ void Validators::checkGroup(const std::string& group) {
     THROW_MQEXCEPTION(MQClientException, "the specified group is blank", -1);
   }
 
-  if (!regularExpressionMatcher(group, validPatternStr)) {
-    std::string str = "the specified group[" + group + "] contains illegal characters, allowing only" + validPatternStr;
+  if (!regularExpressionMatcher(group, VALID_PATTERN_STR)) {
+    std::string str =
+        "the specified group[" + group + "] contains illegal characters, allowing only" + VALID_PATTERN_STR;
     THROW_MQEXCEPTION(MQClientException, str, -1);
   }
   if ((int)group.length() > CHARACTER_MAX_LENGTH) {
diff --git a/src/common/Validators.h b/src/common/Validators.h
index 3ffe527..f00df1d 100644
--- a/src/common/Validators.h
+++ b/src/common/Validators.h
@@ -14,13 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __VALIDATORST_H__
-#define __VALIDATORST_H__
+#ifndef ROCKETMQ_COMMON_VALIDATORST_H_
+#define ROCKETMQ_COMMON_VALIDATORST_H_
 
-#include <string>
-
-#include "MQClientException.h"
 #include "Message.h"
+#include "MQException.h"
 #include "UtilAll.h"
 
 namespace rocketmq {
@@ -32,12 +30,8 @@ class Validators {
   static void checkTopic(const std::string& topic);
   static void checkGroup(const std::string& group);
   static void checkMessage(const Message& msg, int maxMessageSize);
-
- public:
-  static const std::string validPatternStr;
-  static const int CHARACTER_MAX_LENGTH;
 };
 
 }  // namespace rocketmq
 
-#endif  // __VALIDATORST_H__
+#endif  // ROCKETMQ_COMMON_VALIDATORST_H_
diff --git a/src/common/VirtualEnvUtil.cpp b/src/common/VirtualEnvUtil.cpp
index 8dab46e..14a0b5c 100644
--- a/src/common/VirtualEnvUtil.cpp
+++ b/src/common/VirtualEnvUtil.cpp
@@ -21,9 +21,9 @@
 
 #include "UtilAll.h"
 
-namespace rocketmq {
+static const char* VIRTUAL_APPGROUP_PREFIX = "%%PROJECT_%s%%";
 
-const char* VirtualEnvUtil::VIRTUAL_APPGROUP_PREFIX = "%%PROJECT_%s%%";
+namespace rocketmq {
 
 std::string VirtualEnvUtil::buildWithProjectGroup(const std::string& origin, const std::string& projectGroup) {
   if (!UtilAll::isBlank(projectGroup)) {
diff --git a/src/common/VirtualEnvUtil.h b/src/common/VirtualEnvUtil.h
index 2c96f9d..7dfafe6 100644
--- a/src/common/VirtualEnvUtil.h
+++ b/src/common/VirtualEnvUtil.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __VIRTUAL_ENV_UTIL_H__
-#define __VIRTUAL_ENV_UTIL_H__
+#ifndef RROCKETMQ_COMMON_VIRTUALENVUTIL_H_
+#define RROCKETMQ_COMMON_VIRTUALENVUTIL_H_
 
 #include <string>
 
@@ -25,11 +25,8 @@ class VirtualEnvUtil {
  public:
   static std::string buildWithProjectGroup(const std::string& origin, const std::string& projectGroup);
   static std::string clearProjectGroup(const std::string& origin, const std::string& projectGroup);
-
- public:
-  static const char* VIRTUAL_APPGROUP_PREFIX;
 };
 
 }  // namespace rocketmq
 
-#endif  // __VIRTUAL_ENV_UTIL_H__
+#endif  // RROCKETMQ_COMMON_VIRTUALENVUTIL_H_
diff --git a/src/common/noncopyable.h b/src/common/noncopyable.h
index 50f1b5d..792c7ac 100644
--- a/src/common/noncopyable.h
+++ b/src/common/noncopyable.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __NONCOPYABLE_H__
-#define __NONCOPYABLE_H__
+#ifndef ROCKETMQ_COMMON_NONCOPYABLE_H_
+#define ROCKETMQ_COMMON_NONCOPYABLE_H_
 
 namespace rocketmq {
 
@@ -30,4 +30,4 @@ class noncopyable {
 
 }  // namespace rocketmq
 
-#endif  // __NONCOPYABLE_H__
+#endif  // ROCKETMQ_COMMON_NONCOPYABLE_H_
diff --git a/src/concurrent/concurrent_queue.hpp b/src/concurrent/concurrent_queue.hpp
index 20ae5f5..d826f30 100644
--- a/src/concurrent/concurrent_queue.hpp
+++ b/src/concurrent/concurrent_queue.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __CONCURRENT_QUEUE_HPP__
-#define __CONCURRENT_QUEUE_HPP__
+#ifndef ROCKETMQ_CONCURRENT_CONCURRENTQUEUE_HPP_
+#define ROCKETMQ_CONCURRENT_CONCURRENTQUEUE_HPP_
 
 #include <atomic>
 #include <memory>
@@ -152,4 +152,4 @@ class concurrent_queue {
 
 }  // namespace rocketmq
 
-#endif  // __CONCURRENT_QUEUE_HPP__
+#endif  // ROCKETMQ_CONCURRENT_CONCURRENTQUEUE_HPP_
diff --git a/src/concurrent/executor.hpp b/src/concurrent/executor.hpp
index 7f530d9..84a7c4c 100644
--- a/src/concurrent/executor.hpp
+++ b/src/concurrent/executor.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __EXECUTOR_HPP__
-#define __EXECUTOR_HPP__
+#ifndef ROCKETMQ_CONCURRENT_EXECUTOR_HPP_
+#define ROCKETMQ_CONCURRENT_EXECUTOR_HPP_
 
 #include <functional>
 #include <future>
@@ -83,4 +83,4 @@ class scheduled_executor_service : virtual public executor_service {
 
 #include "executor_impl.hpp"
 
-#endif  // __EXECUTOR_HPP__
+#endif  // ROCKETMQ_CONCURRENT_EXECUTOR_HPP_
diff --git a/src/concurrent/executor_impl.hpp b/src/concurrent/executor_impl.hpp
index 10acdd5..89b90dd 100644
--- a/src/concurrent/executor_impl.hpp
+++ b/src/concurrent/executor_impl.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __EXECUTOR_IMPL_HPP__
-#define __EXECUTOR_IMPL_HPP__
+#ifndef ROCKETMQ_CONCURRENT_EXECUTORIMPL_HPP_
+#define ROCKETMQ_CONCURRENT_EXECUTORIMPL_HPP_
 
 #include <atomic>
 #include <functional>
@@ -40,14 +40,14 @@ class abstract_executor_service : virtual public executor_service {
 
 class thread_pool_executor : public abstract_executor_service {
  public:
-  explicit thread_pool_executor(std::size_t num_threads, bool start_immediately = true)
-      : task_queue_(), state_(STOP), num_threads_(num_threads), free_threads_(0) {
+  explicit thread_pool_executor(std::size_t thread_nums, bool start_immediately = true)
+      : task_queue_(), state_(STOP), thread_nums_(thread_nums), free_threads_(0) {
     if (start_immediately) {
       startup();
     }
   }
-  explicit thread_pool_executor(const std::string& name, std::size_t num_threads, bool start_immediately = true)
-      : task_queue_(), state_(STOP), num_threads_(num_threads), thread_group_(name), free_threads_(0) {
+  explicit thread_pool_executor(const std::string& name, std::size_t thread_nums, bool start_immediately = true)
+      : task_queue_(), state_(STOP), thread_nums_(thread_nums), thread_group_(name), free_threads_(0) {
     if (start_immediately) {
       startup();
     }
@@ -56,7 +56,7 @@ class thread_pool_executor : public abstract_executor_service {
   virtual void startup() {
     if (state_ == STOP) {
       state_ = RUNNING;
-      thread_group_.create_threads(std::bind(&thread_pool_executor::run, this), num_threads_);
+      thread_group_.create_threads(std::bind(&thread_pool_executor::run, this), thread_nums_);
       thread_group_.start();
     }
   }
@@ -72,7 +72,7 @@ class thread_pool_executor : public abstract_executor_service {
 
   bool is_shutdown() override { return state_ != RUNNING; }
 
-  std::size_t num_threads() { return num_threads_; }
+  std::size_t thread_nums() { return thread_nums_; }
 
  protected:
   static const unsigned int ACCEPT_NEW_TASKS = 1U << 0U;
@@ -119,7 +119,7 @@ class thread_pool_executor : public abstract_executor_service {
  private:
   state state_;
 
-  std::size_t num_threads_;
+  std::size_t thread_nums_;
   thread_group thread_group_;
 
   std::mutex wakeup_mutex_;
@@ -145,8 +145,8 @@ struct scheduled_executor_handler : public executor_handler {
 
 class scheduled_thread_pool_executor : public thread_pool_executor, virtual public scheduled_executor_service {
  public:
-  explicit scheduled_thread_pool_executor(std::size_t num_threads, bool start_immediately = true)
-      : thread_pool_executor(num_threads, false),
+  explicit scheduled_thread_pool_executor(std::size_t thread_nums, bool start_immediately = true)
+      : thread_pool_executor(thread_nums, false),
         time_queue_(&scheduled_executor_handler::less),
         stopped_(true),
         single_thread_(false),
@@ -157,9 +157,9 @@ class scheduled_thread_pool_executor : public thread_pool_executor, virtual publ
     }
   }
   explicit scheduled_thread_pool_executor(const std::string& name,
-                                          std::size_t num_threads,
+                                          std::size_t thread_nums,
                                           bool start_immediately = true)
-      : thread_pool_executor(name, num_threads, false),
+      : thread_pool_executor(name, thread_nums, false),
         time_queue_(&scheduled_executor_handler::less),
         stopped_(true),
         single_thread_(false),
@@ -305,4 +305,4 @@ class scheduled_thread_pool_executor : public thread_pool_executor, virtual publ
 
 }  // namespace rocketmq
 
-#endif  // __EXECUTOR_IMPL_HPP__
+#endif  // ROCKETMQ_CONCURRENT_EXECUTORIMPL_HPP_
diff --git a/src/concurrent/latch.hpp b/src/concurrent/latch.hpp
index 088dc32..b583f8f 100644
--- a/src/concurrent/latch.hpp
+++ b/src/concurrent/latch.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __LATCH_HPP__
-#define __LATCH_HPP__
+#ifndef ROCKETMQ_CONCURRENT_LATCH_HPP_
+#define ROCKETMQ_CONCURRENT_LATCH_HPP_
 
 #include <atomic>
 #include <cassert>
@@ -143,4 +143,4 @@ class latch {
 
 }  // namespace rocketmq
 
-#endif  // __LATCH_HPP__
+#endif  // ROCKETMQ_CONCURRENT_LATCH_HPP_
diff --git a/src/concurrent/thread.hpp b/src/concurrent/thread.hpp
index 67d3d8e..6a2048a 100644
--- a/src/concurrent/thread.hpp
+++ b/src/concurrent/thread.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __THREAD_HPP__
-#define __THREAD_HPP__
+#ifndef ROCKETMQ_CONCURRENT_THREAD_HPP_
+#define ROCKETMQ_CONCURRENT_THREAD_HPP_
 
 #include <functional>
 #include <memory>
@@ -165,4 +165,4 @@ class thread {
 
 }  // namespace rocketmq
 
-#endif  // __THREAD_HPP__
+#endif  // ROCKETMQ_CONCURRENT_THREAD_HPP_
diff --git a/src/concurrent/thread_group.hpp b/src/concurrent/thread_group.hpp
index 59bcd9a..11548d6 100644
--- a/src/concurrent/thread_group.hpp
+++ b/src/concurrent/thread_group.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __THREAD_GROUP_HPP__
-#define __THREAD_GROUP_HPP__
+#ifndef ROCKETMQ_CONCURRENT_THREADGROUP_HPP_
+#define ROCKETMQ_CONCURRENT_THREADGROUP_HPP_
 
 #include "thread.hpp"
 
@@ -28,8 +28,8 @@ class thread_group {
   thread_group(const std::string& name) : name_(name), first_(nullptr) {}
 
   template <typename Function>
-  thread_group(const std::string& name, Function f, std::size_t num_threads) : name_(name), first_(nullptr) {
-    create_threads(f, num_threads);
+  thread_group(const std::string& name, Function f, std::size_t thread_nums) : name_(name), first_(nullptr) {
+    create_threads(f, thread_nums);
   }
 
   // Destructor joins any remaining threads in the group.
@@ -43,8 +43,8 @@ class thread_group {
 
   // Create new threads in the group.
   template <typename Function>
-  void create_threads(Function f, std::size_t num_threads) {
-    for (std::size_t i = 0; i < num_threads; ++i) {
+  void create_threads(Function f, std::size_t thread_nums) {
+    for (std::size_t i = 0; i < thread_nums; ++i) {
       create_thread(f);
     }
   }
@@ -90,4 +90,4 @@ class thread_group {
 
 }  // namespace rocketmq
 
-#endif  // __THREAD_GROUP_HPP__
+#endif  // ROCKETMQ_CONCURRENT_THREADGROUP_HPP_
diff --git a/src/concurrent/time.hpp b/src/concurrent/time.hpp
index ccb3c0a..fef4f4e 100644
--- a/src/concurrent/time.hpp
+++ b/src/concurrent/time.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __TIME_HPP__
-#define __TIME_HPP__
+#ifndef ROCKETMQ_CONCURRENT_TIME_HPP_
+#define ROCKETMQ_CONCURRENT_TIME_HPP_
 
 #include <cassert>
 #include <chrono>
@@ -48,4 +48,4 @@ inline std::chrono::steady_clock::time_point until_time_point(long delay, time_u
 
 }  // namespace rocketmq
 
-#endif  // __TIME_HPP__
+#endif  // ROCKETMQ_CONCURRENT_TIME_HPP_
diff --git a/src/consumer/AllocateMQAveragely.h b/src/consumer/AllocateMQAveragely.hpp
similarity index 93%
rename from src/consumer/AllocateMQAveragely.h
rename to src/consumer/AllocateMQAveragely.hpp
index d0acc20..15a3d2c 100644
--- a/src/consumer/AllocateMQAveragely.h
+++ b/src/consumer/AllocateMQAveragely.hpp
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __ALLOCATE_MQ_AVERAGELY_H__
-#define __ALLOCATE_MQ_AVERAGELY_H__
+#ifndef ROCKETMQ_CONSUMER_ALLOCATEMQAVERAGELY_HPP_
+#define ROCKETMQ_CONSUMER_ALLOCATEMQAVERAGELY_HPP_
 
 #include <algorithm>
 
 #include "AllocateMQStrategy.h"
 #include "Logging.h"
-#include "MQClientException.h"
+#include "MQException.h"
 
 namespace rocketmq {
 
@@ -80,4 +80,4 @@ class AllocateMQAveragely : public AllocateMQStrategy {
 
 }  // namespace rocketmq
 
-#endif  // __ALLOCATE_MQ_AVERAGELY_H__
+#endif  // ROCKETMQ_CONSUMER_ALLOCATEMQAVERAGELY_HPP_
diff --git a/src/consumer/ConsumeMessageConcurrentlyService.cpp b/src/consumer/ConsumeMessageConcurrentlyService.cpp
index 42cde12..5c3c2f9 100755
--- a/src/consumer/ConsumeMessageConcurrentlyService.cpp
+++ b/src/consumer/ConsumeMessageConcurrentlyService.cpp
@@ -15,8 +15,9 @@
  * limitations under the License.
  */
 #include "ConsumeMsgService.h"
+
 #include "Logging.h"
-#include "MessageAccessor.h"
+#include "MessageAccessor.hpp"
 #include "OffsetStore.h"
 #include "UtilAll.h"
 
@@ -25,36 +26,36 @@ namespace rocketmq {
 ConsumeMessageConcurrentlyService::ConsumeMessageConcurrentlyService(DefaultMQPushConsumerImpl* consumer,
                                                                      int threadCount,
                                                                      MQMessageListener* msgListener)
-    : m_consumer(consumer),
-      m_messageListener(msgListener),
-      m_consumeExecutor("ConsumeMessageThread", threadCount, false),
-      m_scheduledExecutorService("ConsumeMessageScheduledThread", false) {}
+    : consumer_(consumer),
+      message_listener_(msgListener),
+      consume_executor_("ConsumeMessageThread", threadCount, false),
+      scheduled_executor_service_("ConsumeMessageScheduledThread", false) {}
 
 ConsumeMessageConcurrentlyService::~ConsumeMessageConcurrentlyService() = default;
 
 void ConsumeMessageConcurrentlyService::start() {
   // start callback threadpool
-  m_consumeExecutor.startup();
-  m_scheduledExecutorService.startup();
+  consume_executor_.startup();
+  scheduled_executor_service_.startup();
 }
 
 void ConsumeMessageConcurrentlyService::shutdown() {
-  m_scheduledExecutorService.shutdown();
-  m_consumeExecutor.shutdown();
+  scheduled_executor_service_.shutdown();
+  consume_executor_.shutdown();
 }
 
 void ConsumeMessageConcurrentlyService::submitConsumeRequest(std::vector<MessageExtPtr>& msgs,
                                                              ProcessQueuePtr processQueue,
                                                              const MQMessageQueue& messageQueue,
                                                              const bool dispathToConsume) {
-  m_consumeExecutor.submit(
+  consume_executor_.submit(
       std::bind(&ConsumeMessageConcurrentlyService::ConsumeRequest, this, msgs, processQueue, messageQueue));
 }
 
 void ConsumeMessageConcurrentlyService::submitConsumeRequestLater(std::vector<MessageExtPtr>& msgs,
                                                                   ProcessQueuePtr processQueue,
                                                                   const MQMessageQueue& messageQueue) {
-  m_scheduledExecutorService.schedule(
+  scheduled_executor_service_.schedule(
       std::bind(&ConsumeMessageConcurrentlyService::submitConsumeRequest, this, msgs, processQueue, messageQueue, true),
       5000L, time_unit::milliseconds);
 }
@@ -62,9 +63,9 @@ void ConsumeMessageConcurrentlyService::submitConsumeRequestLater(std::vector<Me
 void ConsumeMessageConcurrentlyService::ConsumeRequest(std::vector<MessageExtPtr>& msgs,
                                                        ProcessQueuePtr processQueue,
                                                        const MQMessageQueue& messageQueue) {
-  if (processQueue->isDropped()) {
+  if (processQueue->dropped()) {
     LOG_WARN_NEW("the message queue not be able to consume, because it's dropped. group={} {}",
-                 m_consumer->getDefaultMQPushConsumerConfig()->getGroupName(), messageQueue.toString());
+                 consumer_->getDefaultMQPushConsumerConfig()->getGroupName(), messageQueue.toString());
     return;
   }
 
@@ -74,13 +75,13 @@ void ConsumeMessageConcurrentlyService::ConsumeRequest(std::vector<MessageExtPtr
     return;
   }
 
-  m_consumer->resetRetryTopic(
-      msgs, m_consumer->getDefaultMQPushConsumerConfig()->getGroupName());  // set where to sendMessageBack
+  consumer_->resetRetryTopic(
+      msgs, consumer_->getDefaultMQPushConsumerConfig()->getGroupName());  // set where to sendMessageBack
 
   ConsumeStatus status = RECONSUME_LATER;
   try {
     auto consumeTimestamp = UtilAll::currentTimeMillis();
-    processQueue->setLastConsumeTimestamp(consumeTimestamp);
+    processQueue->set_last_consume_timestamp(consumeTimestamp);
     if (!msgs.empty()) {
       auto timestamp = UtilAll::to_string(consumeTimestamp);
       for (const auto& msg : msgs) {
@@ -92,12 +93,12 @@ void ConsumeMessageConcurrentlyService::ConsumeRequest(std::vector<MessageExtPtr
     for (const auto& msg : msgs) {
       message_list.emplace_back(msg);
     }
-    status = m_messageListener->consumeMessage(message_list);
+    status = message_listener_->consumeMessage(message_list);
   } catch (const std::exception& e) {
     LOG_WARN_NEW("encounter unexpected exception when consume messages.\n{}", e.what());
   }
 
-  if (processQueue->isDropped()) {
+  if (processQueue->dropped()) {
     LOG_WARN_NEW("processQueue is dropped without process consume result. messageQueue={}", messageQueue.toString());
     return;
   }
@@ -117,7 +118,7 @@ void ConsumeMessageConcurrentlyService::ConsumeRequest(std::vector<MessageExtPtr
       break;
   }
 
-  switch (m_consumer->messageModel()) {
+  switch (consumer_->messageModel()) {
     case BROADCASTING:
       // Note: broadcasting reconsume should do by application, as it has big affect to broker cluster
       for (size_t i = ackIndex + 1; i < msgs.size(); i++) {
@@ -133,7 +134,7 @@ void ConsumeMessageConcurrentlyService::ConsumeRequest(std::vector<MessageExtPtr
         LOG_WARN_NEW("consume fail, MQ is:{}, its msgId is:{}, index is:{}, reconsume times is:{}",
                      messageQueue.toString(), (*iter)->getMsgId(), idx, (*iter)->getReconsumeTimes());
         auto& msg = (*iter);
-        bool result = m_consumer->sendMessageBack(msg, 0, messageQueue.getBrokerName());
+        bool result = consumer_->sendMessageBack(msg, 0, messageQueue.broker_name());
         if (!result) {
           msg->setReconsumeTimes(msg->getReconsumeTimes() + 1);
           msgBackFailed.push_back(msg);
@@ -154,8 +155,8 @@ void ConsumeMessageConcurrentlyService::ConsumeRequest(std::vector<MessageExtPtr
 
   // update offset
   int64_t offset = processQueue->removeMessage(msgs);
-  if (offset >= 0 && !processQueue->isDropped()) {
-    m_consumer->getOffsetStore()->updateOffset(messageQueue, offset, true);
+  if (offset >= 0 && !processQueue->dropped()) {
+    consumer_->getOffsetStore()->updateOffset(messageQueue, offset, true);
   }
 }
 
diff --git a/src/consumer/ConsumeMessageOrderlyService.cpp b/src/consumer/ConsumeMessageOrderlyService.cpp
index 4404edc..1a3698c 100755
--- a/src/consumer/ConsumeMessageOrderlyService.cpp
+++ b/src/consumer/ConsumeMessageOrderlyService.cpp
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include "ConsumeMsgService.h"
+
 #include "Logging.h"
 #include "OffsetStore.h"
 #include "RebalanceImpl.h"
@@ -22,24 +23,24 @@
 
 namespace rocketmq {
 
-const uint64_t ConsumeMessageOrderlyService::MaxTimeConsumeContinuously = 60000;
+const uint64_t MAX_TIME_CONSUME_CONTINUOUSLY = 60000;
 
 ConsumeMessageOrderlyService::ConsumeMessageOrderlyService(DefaultMQPushConsumerImpl* consumer,
                                                            int threadCount,
                                                            MQMessageListener* msgListener)
-    : m_consumer(consumer),
-      m_messageListener(msgListener),
-      m_consumeExecutor("OderlyConsumeService", threadCount, false),
-      m_scheduledExecutorService(false) {}
+    : consumer_(consumer),
+      message_listener_(msgListener),
+      consume_executor_("OderlyConsumeService", threadCount, false),
+      scheduled_executor_service_(false) {}
 
 ConsumeMessageOrderlyService::~ConsumeMessageOrderlyService() = default;
 
 void ConsumeMessageOrderlyService::start() {
-  m_consumeExecutor.startup();
+  consume_executor_.startup();
 
-  m_scheduledExecutorService.startup();
-  m_scheduledExecutorService.schedule(std::bind(&ConsumeMessageOrderlyService::lockMQPeriodically, this),
-                                      ProcessQueue::RebalanceLockInterval, time_unit::milliseconds);
+  scheduled_executor_service_.startup();
+  scheduled_executor_service_.schedule(std::bind(&ConsumeMessageOrderlyService::lockMQPeriodically, this),
+                                       ProcessQueue::REBALANCE_LOCK_INTERVAL, time_unit::milliseconds);
 }
 
 void ConsumeMessageOrderlyService::shutdown() {
@@ -48,23 +49,23 @@ void ConsumeMessageOrderlyService::shutdown() {
 }
 
 void ConsumeMessageOrderlyService::stopThreadPool() {
-  m_consumeExecutor.shutdown();
-  m_scheduledExecutorService.shutdown();
+  consume_executor_.shutdown();
+  scheduled_executor_service_.shutdown();
 }
 
 void ConsumeMessageOrderlyService::lockMQPeriodically() {
-  m_consumer->getRebalanceImpl()->lockAll();
+  consumer_->getRebalanceImpl()->lockAll();
 
-  m_scheduledExecutorService.schedule(std::bind(&ConsumeMessageOrderlyService::lockMQPeriodically, this),
-                                      ProcessQueue::RebalanceLockInterval, time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&ConsumeMessageOrderlyService::lockMQPeriodically, this),
+                                       ProcessQueue::REBALANCE_LOCK_INTERVAL, time_unit::milliseconds);
 }
 
 void ConsumeMessageOrderlyService::unlockAllMQ() {
-  m_consumer->getRebalanceImpl()->unlockAll(false);
+  consumer_->getRebalanceImpl()->unlockAll(false);
 }
 
 bool ConsumeMessageOrderlyService::lockOneMQ(const MQMessageQueue& mq) {
-  return m_consumer->getRebalanceImpl()->lock(mq);
+  return consumer_->getRebalanceImpl()->lock(mq);
 }
 
 void ConsumeMessageOrderlyService::submitConsumeRequest(std::vector<MessageExtPtr>& msgs,
@@ -72,7 +73,7 @@ void ConsumeMessageOrderlyService::submitConsumeRequest(std::vector<MessageExtPt
                                                         const MQMessageQueue& messageQueue,
                                                         const bool dispathToConsume) {
   if (dispathToConsume) {
-    m_consumeExecutor.submit(
+    consume_executor_.submit(
         std::bind(&ConsumeMessageOrderlyService::ConsumeRequest, this, processQueue, messageQueue));
   }
 }
@@ -88,15 +89,15 @@ void ConsumeMessageOrderlyService::submitConsumeRequestLater(ProcessQueuePtr pro
   timeMillis = std::max(10L, std::min(timeMillis, 30000L));
 
   static std::vector<MessageExtPtr> dummy;
-  m_scheduledExecutorService.schedule(std::bind(&ConsumeMessageOrderlyService::submitConsumeRequest, this,
-                                                std::ref(dummy), processQueue, messageQueue, true),
-                                      timeMillis, time_unit::milliseconds);
+  scheduled_executor_service_.schedule(std::bind(&ConsumeMessageOrderlyService::submitConsumeRequest, this,
+                                                 std::ref(dummy), processQueue, messageQueue, true),
+                                       timeMillis, time_unit::milliseconds);
 }
 
 void ConsumeMessageOrderlyService::tryLockLaterAndReconsume(const MQMessageQueue& mq,
                                                             ProcessQueuePtr processQueue,
                                                             const long delayMills) {
-  m_scheduledExecutorService.schedule(
+  scheduled_executor_service_.schedule(
       [this, mq, processQueue]() {
         bool lockOK = lockOneMQ(mq);
         if (lockOK) {
@@ -109,50 +110,50 @@ void ConsumeMessageOrderlyService::tryLockLaterAndReconsume(const MQMessageQueue
 }
 
 void ConsumeMessageOrderlyService::ConsumeRequest(ProcessQueuePtr processQueue, const MQMessageQueue& messageQueue) {
-  if (processQueue->isDropped()) {
+  if (processQueue->dropped()) {
     LOG_WARN_NEW("run, the message queue not be able to consume, because it's dropped. {}", messageQueue.toString());
     return;
   }
 
-  auto objLock = m_messageQueueLock.fetchLockObject(messageQueue);
+  auto objLock = message_queue_lock_.fetchLockObject(messageQueue);
   std::lock_guard<std::mutex> lock(*objLock);
 
-  if (BROADCASTING == m_consumer->messageModel() || (processQueue->isLocked() && !processQueue->isLockExpired())) {
+  if (BROADCASTING == consumer_->messageModel() || (processQueue->locked() && !processQueue->isLockExpired())) {
     auto beginTime = UtilAll::currentTimeMillis();
     for (bool continueConsume = true; continueConsume;) {
-      if (processQueue->isDropped()) {
+      if (processQueue->dropped()) {
         LOG_WARN_NEW("the message queue not be able to consume, because it's dropped. {}", messageQueue.toString());
         break;
       }
 
-      if (CLUSTERING == m_consumer->messageModel() && !processQueue->isLocked()) {
+      if (CLUSTERING == consumer_->messageModel() && !processQueue->locked()) {
         LOG_WARN_NEW("the message queue not locked, so consume later, {}", messageQueue.toString());
         tryLockLaterAndReconsume(messageQueue, processQueue, 10);
         break;
       }
 
-      if (CLUSTERING == m_consumer->messageModel() && processQueue->isLockExpired()) {
+      if (CLUSTERING == consumer_->messageModel() && processQueue->isLockExpired()) {
         LOG_WARN_NEW("the message queue lock expired, so consume later, {}", messageQueue.toString());
         tryLockLaterAndReconsume(messageQueue, processQueue, 10);
         break;
       }
 
       auto interval = UtilAll::currentTimeMillis() - beginTime;
-      if (interval > MaxTimeConsumeContinuously) {
+      if (interval > MAX_TIME_CONSUME_CONTINUOUSLY) {
         submitConsumeRequestLater(processQueue, messageQueue, 10);
         break;
       }
 
-      const int consumeBatchSize = m_consumer->getDefaultMQPushConsumerConfig()->getConsumeMessageBatchMaxSize();
+      const int consumeBatchSize = consumer_->getDefaultMQPushConsumerConfig()->getConsumeMessageBatchMaxSize();
 
       std::vector<MessageExtPtr> msgs;
       processQueue->takeMessages(msgs, consumeBatchSize);
-      m_consumer->resetRetryTopic(msgs, m_consumer->getDefaultMQPushConsumerConfig()->getGroupName());
+      consumer_->resetRetryTopic(msgs, consumer_->getDefaultMQPushConsumerConfig()->getGroupName());
       if (!msgs.empty()) {
         ConsumeStatus status = RECONSUME_LATER;
         try {
-          std::lock_guard<std::timed_mutex> lock(processQueue->getLockConsume());
-          if (processQueue->isDropped()) {
+          std::lock_guard<std::timed_mutex> lock(processQueue->lock_consume());
+          if (processQueue->dropped()) {
             LOG_WARN_NEW("consumeMessage, the message queue not be able to consume, because it's dropped. {}",
                          messageQueue.toString());
             break;
@@ -162,7 +163,7 @@ void ConsumeMessageOrderlyService::ConsumeRequest(ProcessQueuePtr processQueue,
           for (const auto& msg : msgs) {
             message_list.emplace_back(msg);
           }
-          status = m_messageListener->consumeMessage(message_list);
+          status = message_listener_->consumeMessage(message_list);
         } catch (const std::exception& e) {
           LOG_WARN_NEW("encounter unexpected exception when consume messages.\n{}", e.what());
         }
@@ -182,15 +183,15 @@ void ConsumeMessageOrderlyService::ConsumeRequest(ProcessQueuePtr processQueue,
             break;
         }
 
-        if (commitOffset >= 0 && !processQueue->isDropped()) {
-          m_consumer->getOffsetStore()->updateOffset(messageQueue, commitOffset, false);
+        if (commitOffset >= 0 && !processQueue->dropped()) {
+          consumer_->getOffsetStore()->updateOffset(messageQueue, commitOffset, false);
         }
       } else {
         continueConsume = false;
       }
     }
   } else {
-    if (processQueue->isDropped()) {
+    if (processQueue->dropped()) {
       LOG_WARN_NEW("the message queue not be able to consume, because it's dropped. {}", messageQueue.toString());
       return;
     }
diff --git a/src/consumer/ConsumeMsgService.h b/src/consumer/ConsumeMsgService.h
index b8e1d8a..6f57809 100755
--- a/src/consumer/ConsumeMsgService.h
+++ b/src/consumer/ConsumeMsgService.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __CONSUME_MESSAGE_SERVICE_H__
-#define __CONSUME_MESSAGE_SERVICE_H__
+#ifndef ROCKETMQ_CONSUMER_CONSUMEMSGSERVICE_H_
+#define ROCKETMQ_CONSUMER_CONSUMEMSGSERVICE_H_
 
 #include "DefaultMQPushConsumerImpl.h"
 #include "Logging.h"
@@ -62,11 +62,11 @@ class ConsumeMessageConcurrentlyService : public ConsumeMsgService {
                                  const MQMessageQueue& messageQueue);
 
  private:
-  DefaultMQPushConsumerImpl* m_consumer;
-  MQMessageListener* m_messageListener;
+  DefaultMQPushConsumerImpl* consumer_;
+  MQMessageListener* message_listener_;
 
-  thread_pool_executor m_consumeExecutor;
-  scheduled_thread_pool_executor m_scheduledExecutorService;
+  thread_pool_executor consume_executor_;
+  scheduled_thread_pool_executor scheduled_executor_service_;
 };
 
 class ConsumeMessageOrderlyService : public ConsumeMsgService {
@@ -94,17 +94,14 @@ class ConsumeMessageOrderlyService : public ConsumeMsgService {
   bool lockOneMQ(const MQMessageQueue& mq);
 
  private:
-  static const uint64_t MaxTimeConsumeContinuously;
+  DefaultMQPushConsumerImpl* consumer_;
+  MQMessageListener* message_listener_;
 
- private:
-  DefaultMQPushConsumerImpl* m_consumer;
-  MQMessageListener* m_messageListener;
-
-  MessageQueueLock m_messageQueueLock;
-  thread_pool_executor m_consumeExecutor;
-  scheduled_thread_pool_executor m_scheduledExecutorService;
+  MessageQueueLock message_queue_lock_;
+  thread_pool_executor consume_executor_;
+  scheduled_thread_pool_executor scheduled_executor_service_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __CONSUME_MESSAGE_SERVICE_H__
+#endif  // ROCKETMQ_CONSUMER_CONSUMEMSGSERVICE_H_
diff --git a/src/consumer/DefaultMQPullConsumerImpl.cpp b/src/consumer/DefaultMQPullConsumerImpl.cpp
index e72defd..78845cf 100644
--- a/src/consumer/DefaultMQPullConsumerImpl.cpp
+++ b/src/consumer/DefaultMQPullConsumerImpl.cpp
@@ -276,7 +276,7 @@
 // }
 
 // void DefaultMQPullConsumer::subscriptionAutomatically(const std::string& topic) {
-//   SubscriptionDataPtr pSdata = m_rebalanceImpl->getSubscriptionData(topic);
+//   SubscriptionData* pSdata = m_rebalanceImpl->getSubscriptionData(topic);
 //   if (pSdata == nullptr) {
 //     std::unique_ptr<SubscriptionData> subscriptionData(FilterAPI::buildSubscriptionData(topic, SUB_ALL));
 //     m_rebalanceImpl->setSubscriptionData(topic, subscriptionData.release());
diff --git a/src/consumer/DefaultMQPushConsumer.cpp b/src/consumer/DefaultMQPushConsumer.cpp
index d729948..f5a80d9 100644
--- a/src/consumer/DefaultMQPushConsumer.cpp
+++ b/src/consumer/DefaultMQPushConsumer.cpp
@@ -16,7 +16,7 @@
  */
 #include "DefaultMQPushConsumer.h"
 
-#include "DefaultMQPushConsumerConfigImpl.h"
+#include "DefaultMQPushConsumerConfigImpl.hpp"
 #include "DefaultMQPushConsumerImpl.h"
 #include "UtilAll.h"
 
@@ -35,7 +35,8 @@ DefaultMQPushConsumer::DefaultMQPushConsumer(const std::string& groupname, RPCHo
     setGroupName(groupname);
   }
 
-  push_consumer_impl_ = DefaultMQPushConsumerImpl::create(getRealConfig(), rpcHook);
+  // create DefaultMQPushConsumerImpl
+  push_consumer_impl_ = DefaultMQPushConsumerImpl::create(real_config(), rpcHook);
 }
 
 DefaultMQPushConsumer::~DefaultMQPushConsumer() = default;
@@ -89,7 +90,7 @@ void DefaultMQPushConsumer::resume() {
 }
 
 void DefaultMQPushConsumer::setRPCHook(RPCHookPtr rpcHook) {
-  std::dynamic_pointer_cast<DefaultMQPushConsumerImpl>(push_consumer_impl_)->setRPCHook(rpcHook);
+  dynamic_cast<DefaultMQPushConsumerImpl*>(push_consumer_impl_.get())->setRPCHook(rpcHook);
 }
 
 }  // namespace rocketmq
diff --git a/src/consumer/DefaultMQPushConsumerConfigImpl.cpp b/src/consumer/DefaultMQPushConsumerConfigImpl.cpp
deleted file mode 100644
index 560a6be..0000000
--- a/src/consumer/DefaultMQPushConsumerConfigImpl.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "DefaultMQPushConsumerConfigImpl.h"
-
-#include <algorithm>
-#include <thread>
-
-#include "AllocateMQAveragely.h"
-
-namespace rocketmq {
-
-DefaultMQPushConsumerConfigImpl::DefaultMQPushConsumerConfigImpl()
-    : m_messageModel(CLUSTERING),
-      m_consumeFromWhere(CONSUME_FROM_LAST_OFFSET),
-      m_consumeTimestamp("0"),
-      m_consumeThreadNum(std::min(8, (int)std::thread::hardware_concurrency())),
-      m_consumeMessageBatchMaxSize(1),
-      m_maxMsgCacheSize(1000),
-      m_asyncPullTimeout(30 * 1000),
-      m_maxReconsumeTimes(-1),
-      m_pullTimeDelayMillsWhenException(3000),
-      m_allocateMQStrategy(new AllocateMQAveragely()) {}
-
-MessageModel DefaultMQPushConsumerConfigImpl::getMessageModel() const {
-  return m_messageModel;
-}
-
-void DefaultMQPushConsumerConfigImpl::setMessageModel(MessageModel messageModel) {
-  m_messageModel = messageModel;
-}
-
-ConsumeFromWhere DefaultMQPushConsumerConfigImpl::getConsumeFromWhere() const {
-  return m_consumeFromWhere;
-}
-
-void DefaultMQPushConsumerConfigImpl::setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) {
-  m_consumeFromWhere = consumeFromWhere;
-}
-
-std::string DefaultMQPushConsumerConfigImpl::getConsumeTimestamp() {
-  return m_consumeTimestamp;
-}
-
-void DefaultMQPushConsumerConfigImpl::setConsumeTimestamp(std::string consumeTimestamp) {
-  m_consumeTimestamp = consumeTimestamp;
-}
-
-int DefaultMQPushConsumerConfigImpl::getConsumeThreadNum() const {
-  return m_consumeThreadNum;
-}
-
-void DefaultMQPushConsumerConfigImpl::setConsumeThreadNum(int threadNum) {
-  if (threadNum > 0) {
-    m_consumeThreadNum = threadNum;
-  }
-}
-
-int DefaultMQPushConsumerConfigImpl::getConsumeMessageBatchMaxSize() const {
-  return m_consumeMessageBatchMaxSize;
-}
-
-void DefaultMQPushConsumerConfigImpl::setConsumeMessageBatchMaxSize(int consumeMessageBatchMaxSize) {
-  if (consumeMessageBatchMaxSize >= 1) {
-    m_consumeMessageBatchMaxSize = consumeMessageBatchMaxSize;
-  }
-}
-
-int DefaultMQPushConsumerConfigImpl::getMaxCacheMsgSizePerQueue() const {
-  return m_maxMsgCacheSize;
-}
-
-void DefaultMQPushConsumerConfigImpl::setMaxCacheMsgSizePerQueue(int maxCacheSize) {
-  if (maxCacheSize > 0 && maxCacheSize < 65535) {
-    m_maxMsgCacheSize = maxCacheSize;
-  }
-}
-
-int DefaultMQPushConsumerConfigImpl::getAsyncPullTimeout() const {
-  return m_asyncPullTimeout;
-}
-
-void DefaultMQPushConsumerConfigImpl::setAsyncPullTimeout(int asyncPullTimeout) {
-  m_asyncPullTimeout = asyncPullTimeout;
-}
-
-int DefaultMQPushConsumerConfigImpl::getMaxReconsumeTimes() const {
-  return m_maxReconsumeTimes;
-}
-
-void DefaultMQPushConsumerConfigImpl::setMaxReconsumeTimes(int maxReconsumeTimes) {
-  m_maxReconsumeTimes = maxReconsumeTimes;
-}
-
-long DefaultMQPushConsumerConfigImpl::getPullTimeDelayMillsWhenException() const {
-  return m_pullTimeDelayMillsWhenException;
-}
-
-void DefaultMQPushConsumerConfigImpl::setPullTimeDelayMillsWhenException(long pullTimeDelayMillsWhenException) {
-  m_pullTimeDelayMillsWhenException = pullTimeDelayMillsWhenException;
-}
-
-AllocateMQStrategy* DefaultMQPushConsumerConfigImpl::getAllocateMQStrategy() const {
-  return m_allocateMQStrategy.get();
-}
-
-void DefaultMQPushConsumerConfigImpl::setAllocateMQStrategy(AllocateMQStrategy* strategy) {
-  m_allocateMQStrategy.reset(strategy);
-}
-
-}  // namespace rocketmq
diff --git a/src/consumer/DefaultMQPushConsumerConfigImpl.h b/src/consumer/DefaultMQPushConsumerConfigImpl.h
deleted file mode 100644
index 1ca6013..0000000
--- a/src/consumer/DefaultMQPushConsumerConfigImpl.h
+++ /dev/null
@@ -1,81 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_IMPL_H__
-#define __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_IMPL_H__
-
-#include "DefaultMQPushConsumerConfig.h"
-#include "MQClientConfigImpl.h"
-
-namespace rocketmq {
-
-class DefaultMQPushConsumerConfigImpl : virtual public DefaultMQPushConsumerConfig, public MQClientConfigImpl {
- public:
-  DefaultMQPushConsumerConfigImpl();
-  virtual ~DefaultMQPushConsumerConfigImpl() = default;
-
-  MessageModel getMessageModel() const override;
-  void setMessageModel(MessageModel messageModel) override;
-
-  ConsumeFromWhere getConsumeFromWhere() const override;
-  void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) override;
-
-  std::string getConsumeTimestamp() override;
-  void setConsumeTimestamp(std::string consumeTimestamp) override;
-
-  int getConsumeThreadNum() const override;
-  void setConsumeThreadNum(int threadNum) override;
-
-  int getConsumeMessageBatchMaxSize() const override;
-  void setConsumeMessageBatchMaxSize(int consumeMessageBatchMaxSize) override;
-
-  int getMaxCacheMsgSizePerQueue() const override;
-  void setMaxCacheMsgSizePerQueue(int maxCacheSize) override;
-
-  int getAsyncPullTimeout() const override;
-  void setAsyncPullTimeout(int asyncPullTimeout) override;
-
-  int getMaxReconsumeTimes() const override;
-  void setMaxReconsumeTimes(int maxReconsumeTimes) override;
-
-  long getPullTimeDelayMillsWhenException() const override;
-  void setPullTimeDelayMillsWhenException(long pullTimeDelayMillsWhenException) override;
-
-  AllocateMQStrategy* getAllocateMQStrategy() const override;
-  void setAllocateMQStrategy(AllocateMQStrategy* strategy) override;
-
- protected:
-  MessageModel m_messageModel;
-
-  ConsumeFromWhere m_consumeFromWhere;
-  std::string m_consumeTimestamp;
-
-  int m_consumeThreadNum;
-  int m_consumeMessageBatchMaxSize;
-  int m_maxMsgCacheSize;
-
-  int m_asyncPullTimeout;  // 30s
-  int m_maxReconsumeTimes;
-
-  long m_pullTimeDelayMillsWhenException;  // 3000
-
-  std::unique_ptr<AllocateMQStrategy> m_allocateMQStrategy;
-};
-
-}  // namespace rocketmq
-
-#endif  // __DEFAULT_MQ_PUSH_CONSUMER_CONFIG_IMPL_H__
\ No newline at end of file
diff --git a/src/consumer/DefaultMQPushConsumerConfigImpl.hpp b/src/consumer/DefaultMQPushConsumerConfigImpl.hpp
new file mode 100644
index 0000000..1b1f1eb
--- /dev/null
+++ b/src/consumer/DefaultMQPushConsumerConfigImpl.hpp
@@ -0,0 +1,112 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ROCKETMQ_CONSUMER_DEFAULTMQPUSHCONSUMERCONFIGIMPL_HPP_
+#define ROCKETMQ_CONSUMER_DEFAULTMQPUSHCONSUMERCONFIGIMPL_HPP_
+
+#include <algorithm>  // std::min
+#include <thread>     // std::thread::hardware_concurrency
+
+#include "AllocateMQAveragely.hpp"
+#include "DefaultMQPushConsumerConfig.h"
+#include "MQClientConfigImpl.hpp"
+
+namespace rocketmq {
+
+/**
+ * DefaultMQPushConsumerConfigImpl - implement for DefaultMQPushConsumerConfig
+ */
+class DefaultMQPushConsumerConfigImpl : virtual public DefaultMQPushConsumerConfig, public MQClientConfigImpl {
+ public:
+  DefaultMQPushConsumerConfigImpl()
+      : message_model_(MessageModel::CLUSTERING),
+        consume_from_where_(ConsumeFromWhere::CONSUME_FROM_LAST_OFFSET),
+        consume_timestamp_("0"),
+        consume_thread_num_(std::min(8, (int)std::thread::hardware_concurrency())),
+        consume_message_batch_max_size_(1),
+        max_msg_cache_size_(1000),
+        async_pull_timeout_(30 * 1000),
+        max_reconsume_times_(-1),
+        pull_time_delay_mills_when_exception_(3000),
+        allocate_mq_strategy_(new AllocateMQAveragely()) {}
+  virtual ~DefaultMQPushConsumerConfigImpl() = default;
+
+  MessageModel getMessageModel() const override { return message_model_; }
+  void setMessageModel(MessageModel messageModel) override { message_model_ = messageModel; }
+
+  ConsumeFromWhere getConsumeFromWhere() const override { return consume_from_where_; }
+  void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) override { consume_from_where_ = consumeFromWhere; }
+
+  const std::string& getConsumeTimestamp() const override { return consume_timestamp_; }
+  void setConsumeTimestamp(const std::string& consumeTimestamp) override { consume_timestamp_ = consumeTimestamp; }
+
+  int getConsumeThreadNum() const override { return consume_thread_num_; }
+  void setConsumeThreadNum(int threadNum) override {
+    if (threadNum > 0) {
+      consume_thread_num_ = threadNum;
+    }
+  }
+
+  int getConsumeMessageBatchMaxSize() const override { return consume_message_batch_max_size_; }
+  void setConsumeMessageBatchMaxSize(int consumeMessageBatchMaxSize) override {
+    if (consumeMessageBatchMaxSize >= 1) {
+      consume_message_batch_max_size_ = consumeMessageBatchMaxSize;
+    }
+  }
+
+  int getMaxCacheMsgSizePerQueue() const override { return max_msg_cache_size_; }
+  void setMaxCacheMsgSizePerQueue(int maxCacheSize) override {
+    if (maxCacheSize > 0 && maxCacheSize < 65535) {
+      max_msg_cache_size_ = maxCacheSize;
+    }
+  }
+
+  int getAsyncPullTimeout() const override { return async_pull_timeout_; }
+  void setAsyncPullTimeout(int asyncPullTimeout) override { async_pull_timeout_ = asyncPullTimeout; }
+
+  int getMaxReconsumeTimes() const override { return max_reconsume_times_; }
+  void setMaxReconsumeTimes(int maxReconsumeTimes) override { max_reconsume_times_ = maxReconsumeTimes; }
+
+  long getPullTimeDelayMillsWhenException() const override { return pull_time_delay_mills_when_exception_; }
+  void setPullTimeDelayMillsWhenException(long pullTimeDelayMillsWhenException) override {
+    pull_time_delay_mills_when_exception_ = pullTimeDelayMillsWhenException;
+  }
+
+  AllocateMQStrategy* getAllocateMQStrategy() const override { return allocate_mq_strategy_.get(); }
+  void setAllocateMQStrategy(AllocateMQStrategy* strategy) override { allocate_mq_strategy_.reset(strategy); }
+
+ protected:
+  MessageModel message_model_;
+
+  ConsumeFromWhere consume_from_where_;
+  std::string consume_timestamp_;
+
+  int consume_thread_num_;
+  int consume_message_batch_max_size_;
+  int max_msg_cache_size_;
+
+  int async_pull_timeout_;  // 30s
+  int max_reconsume_times_;
+
+  long pull_time_delay_mills_when_exception_;  // 3000
+
+  std::unique_ptr<AllocateMQStrategy> allocate_mq_strategy_;
+};
+
+}  // namespace rocketmq
+
+#endif  // ROCKETMQ_CONSUMER_DEFAULTMQPUSHCONSUMERCONFIGIMPL_HPP_
\ No newline at end of file
diff --git a/src/consumer/DefaultMQPushConsumerImpl.cpp b/src/consumer/DefaultMQPushConsumerImpl.cpp
index 6e83861..71097b2 100644
--- a/src/consumer/DefaultMQPushConsumerImpl.cpp
+++ b/src/consumer/DefaultMQPushConsumerImpl.cpp
@@ -23,18 +23,19 @@
 #include "CommunicationMode.h"
 #include "ConsumeMsgService.h"
 #include "ConsumerRunningInfo.h"
-#include "FilterAPI.h"
+#include "FilterAPI.hpp"
 #include "Logging.h"
 #include "MQAdminImpl.h"
 #include "MQClientAPIImpl.h"
 #include "MQClientInstance.h"
 #include "MQClientManager.h"
 #include "MQProtos.h"
-#include "OffsetStore.h"
+#include "LocalFileOffsetStore.h"
 #include "PullAPIWrapper.h"
 #include "PullMessageService.hpp"
 #include "PullSysFlag.h"
 #include "RebalancePushImpl.h"
+#include "RemoteBrokerOffsetStore.h"
 #include "SocketUtil.h"
 #include "UtilAll.h"
 #include "Validators.h"
@@ -45,40 +46,36 @@ class AsyncPullCallback : public AutoDeletePullCallback {
  public:
   AsyncPullCallback(DefaultMQPushConsumerImplPtr pushConsumer,
                     PullRequestPtr request,
-                    SubscriptionDataPtr subscriptionData)
-      : m_defaultMQPushConsumer(pushConsumer), m_pullRequest(request), m_subscriptionData(subscriptionData) {}
+                    SubscriptionData* subscriptionData)
+      : default_mq_push_consumer_(pushConsumer), pull_request_(request), subscription_data_(subscriptionData) {}
 
-  ~AsyncPullCallback() override {
-    m_defaultMQPushConsumer.reset();
-    m_pullRequest.reset();
-    m_subscriptionData = nullptr;
-  }
+  ~AsyncPullCallback() = default;
 
   void onSuccess(PullResult& pullResult) override {
-    auto defaultMQPushConsumer = m_defaultMQPushConsumer.lock();
+    auto defaultMQPushConsumer = default_mq_push_consumer_.lock();
     if (nullptr == defaultMQPushConsumer) {
       LOG_WARN_NEW("AsyncPullCallback::onSuccess: DefaultMQPushConsumerImpl is released.");
       return;
     }
 
-    PullResult result = defaultMQPushConsumer->getPullAPIWrapper()->processPullResult(m_pullRequest->getMessageQueue(),
-                                                                                      pullResult, m_subscriptionData);
+    PullResult result = defaultMQPushConsumer->getPullAPIWrapper()->processPullResult(pull_request_->message_queue(),
+                                                                                      pullResult, subscription_data_);
     switch (result.pull_status()) {
       case FOUND: {
-        int64_t prevRequestOffset = m_pullRequest->getNextOffset();
-        m_pullRequest->setNextOffset(result.next_begin_offset());
+        int64_t prevRequestOffset = pull_request_->next_offset();
+        pull_request_->set_next_offset(result.next_begin_offset());
 
         int64_t firstMsgOffset = (std::numeric_limits<int64_t>::max)();
         if (result.msg_found_list().empty()) {
-          defaultMQPushConsumer->executePullRequestImmediately(m_pullRequest);
+          defaultMQPushConsumer->executePullRequestImmediately(pull_request_);
         } else {
           firstMsgOffset = result.msg_found_list()[0]->getQueueOffset();
 
-          m_pullRequest->getProcessQueue()->putMessage(result.msg_found_list());
+          pull_request_->process_queue()->putMessage(result.msg_found_list());
           defaultMQPushConsumer->getConsumerMsgService()->submitConsumeRequest(
-              result.msg_found_list(), m_pullRequest->getProcessQueue(), m_pullRequest->getMessageQueue(), true);
+              result.msg_found_list(), pull_request_->process_queue(), pull_request_->message_queue(), true);
 
-          defaultMQPushConsumer->executePullRequestImmediately(m_pullRequest);
+          defaultMQPushConsumer->executePullRequestImmediately(pull_request_);
         }
 
         if (result.next_begin_offset() < prevRequestOffset || firstMsgOffset < prevRequestOffset) {
@@ -90,32 +87,32 @@ class AsyncPullCallback : public AutoDeletePullCallback {
       } break;
       case NO_NEW_MSG:
       case NO_MATCHED_MSG:
-        m_pullRequest->setNextOffset(result.next_begin_offset());
-        defaultMQPushConsumer->correctTagsOffset(m_pullRequest);
-        defaultMQPushConsumer->executePullRequestImmediately(m_pullRequest);
+        pull_request_->set_next_offset(result.next_begin_offset());
+        defaultMQPushConsumer->correctTagsOffset(pull_request_);
+        defaultMQPushConsumer->executePullRequestImmediately(pull_request_);
         break;
       case NO_LATEST_MSG:
-        m_pullRequest->setNextOffset(result.next_begin_offset());
-        defaultMQPushConsumer->correctTagsOffset(m_pullRequest);
+        pull_request_->set_next_offset(result.next_begin_offset());
+        defaultMQPushConsumer->correctTagsOffset(pull_request_);
         defaultMQPushConsumer->executePullRequestLater(
-            m_pullRequest,
+            pull_request_,
             defaultMQPushConsumer->getDefaultMQPushConsumerConfig()->getPullTimeDelayMillsWhenException());
         break;
       case OFFSET_ILLEGAL: {
-        LOG_WARN_NEW("the pull request offset illegal, {} {}", m_pullRequest->toString(), result.toString());
+        LOG_WARN_NEW("the pull request offset illegal, {} {}", pull_request_->toString(), result.toString());
 
-        m_pullRequest->setNextOffset(result.next_begin_offset());
-        m_pullRequest->getProcessQueue()->setDropped(true);
+        pull_request_->set_next_offset(result.next_begin_offset());
+        pull_request_->process_queue()->set_dropped(true);
 
         // update and persist offset, then removeProcessQueue
-        auto pullRequest = m_pullRequest;
+        auto pullRequest = pull_request_;
         defaultMQPushConsumer->executeTaskLater(
             [defaultMQPushConsumer, pullRequest]() {
               try {
-                defaultMQPushConsumer->getOffsetStore()->updateOffset(pullRequest->getMessageQueue(),
-                                                                      pullRequest->getNextOffset(), false);
-                defaultMQPushConsumer->getOffsetStore()->persist(pullRequest->getMessageQueue());
-                defaultMQPushConsumer->getRebalanceImpl()->removeProcessQueue(pullRequest->getMessageQueue());
+                defaultMQPushConsumer->getOffsetStore()->updateOffset(pullRequest->message_queue(),
+                                                                      pullRequest->next_offset(), false);
+                defaultMQPushConsumer->getOffsetStore()->persist(pullRequest->message_queue());
+                defaultMQPushConsumer->getRebalanceImpl()->removeProcessQueue(pullRequest->message_queue());
 
                 LOG_WARN_NEW("fix the pull request offset, {}", pullRequest->toString());
               } catch (std::exception& e) {
@@ -130,25 +127,25 @@ class AsyncPullCallback : public AutoDeletePullCallback {
   }
 
   void onException(MQException& e) noexcept override {
-    auto defaultMQPushConsumer = m_defaultMQPushConsumer.lock();
+    auto defaultMQPushConsumer = default_mq_push_consumer_.lock();
     if (nullptr == defaultMQPushConsumer) {
       LOG_WARN_NEW("AsyncPullCallback::onException: DefaultMQPushConsumerImpl is released.");
       return;
     }
 
-    if (!UtilAll::isRetryTopic(m_pullRequest->getMessageQueue().getTopic())) {
+    if (!UtilAll::isRetryTopic(pull_request_->message_queue().topic())) {
       LOG_WARN_NEW("execute the pull request exception: {}", e.what());
     }
 
     // TODO
     defaultMQPushConsumer->executePullRequestLater(
-        m_pullRequest, defaultMQPushConsumer->getDefaultMQPushConsumerConfig()->getPullTimeDelayMillsWhenException());
+        pull_request_, defaultMQPushConsumer->getDefaultMQPushConsumerConfig()->getPullTimeDelayMillsWhenException());
   }
 
  private:
-  std::weak_ptr<DefaultMQPushConsumerImpl> m_defaultMQPushConsumer;
-  PullRequestPtr m_pullRequest;
-  SubscriptionDataPtr m_subscriptionData;
+  std::weak_ptr<DefaultMQPushConsumerImpl> default_mq_push_consumer_;
+  PullRequestPtr pull_request_;
+  SubscriptionData* subscription_data_;
 };
 
 DefaultMQPushConsumerImpl::DefaultMQPushConsumerImpl(DefaultMQPushConsumerConfigPtr config)
@@ -156,75 +153,17 @@ DefaultMQPushConsumerImpl::DefaultMQPushConsumerImpl(DefaultMQPushConsumerConfig
 
 DefaultMQPushConsumerImpl::DefaultMQPushConsumerImpl(DefaultMQPushConsumerConfigPtr config, RPCHookPtr rpcHook)
     : MQClientImpl(config, rpcHook),
-      m_pushConsumerConfig(config),
-      m_startTime(UtilAll::currentTimeMillis()),
-      m_pause(false),
-      m_consumeOrderly(false),
-      m_rebalanceImpl(new RebalancePushImpl(this)),
-      m_pullAPIWrapper(nullptr),
-      m_offsetStore(nullptr),
-      m_consumeService(nullptr),
-      m_messageListener(nullptr) {}
+      start_time_(UtilAll::currentTimeMillis()),
+      pause_(false),
+      consume_orderly_(false),
+      rebalance_impl_(new RebalancePushImpl(this)),
+      pull_api_wrapper_(nullptr),
+      offset_store_(nullptr),
+      consume_service_(nullptr),
+      message_listener_(nullptr) {}
 
 DefaultMQPushConsumerImpl::~DefaultMQPushConsumerImpl() = default;
 
-int DefaultMQPushConsumerImpl::getMaxReconsumeTimes() {
-  // default reconsume times: 16
-  if (m_pushConsumerConfig->getMaxReconsumeTimes() == -1) {
-    return 16;
-  } else {
-    return m_pushConsumerConfig->getMaxReconsumeTimes();
-  }
-}
-
-bool DefaultMQPushConsumerImpl::sendMessageBack(MessageExtPtr msg, int delayLevel) {
-  return sendMessageBack(msg, delayLevel, null);
-}
-
-bool DefaultMQPushConsumerImpl::sendMessageBack(MessageExtPtr msg, int delayLevel, const std::string& brokerName) {
-  try {
-    std::string brokerAddr = brokerName.empty() ? socketAddress2String(msg->getStoreHost())
-                                                : m_clientInstance->findBrokerAddressInPublish(brokerName);
-
-    m_clientInstance->getMQClientAPIImpl()->consumerSendMessageBack(
-        brokerAddr, msg, m_pushConsumerConfig->getGroupName(), delayLevel, 5000, getMaxReconsumeTimes());
-    return true;
-  } catch (const std::exception& e) {
-    LOG_ERROR_NEW("sendMessageBack exception, group: {}, msg: {}. {}", m_pushConsumerConfig->getGroupName(),
-                  msg->toString(), e.what());
-  }
-  return false;
-}
-
-void DefaultMQPushConsumerImpl::fetchSubscribeMessageQueues(const std::string& topic,
-                                                            std::vector<MQMessageQueue>& mqs) {
-  mqs.clear();
-  try {
-    m_clientInstance->getMQAdminImpl()->fetchSubscribeMessageQueues(topic, mqs);
-  } catch (MQException& e) {
-    LOG_ERROR_NEW("{}", e.what());
-  }
-}
-
-void DefaultMQPushConsumerImpl::doRebalance() {
-  if (!m_pause) {
-    m_rebalanceImpl->doRebalance(isConsumeOrderly());
-  }
-}
-
-void DefaultMQPushConsumerImpl::persistConsumerOffset() {
-  if (isServiceStateOk()) {
-    std::vector<MQMessageQueue> mqs = m_rebalanceImpl->getAllocatedMQ();
-    if (m_pushConsumerConfig->getMessageModel() == BROADCASTING) {
-      m_offsetStore->persistAll(mqs);
-    } else {
-      for (const auto& mq : mqs) {
-        m_offsetStore->persist(mq);
-      }
-    }
-  }
-}
-
 void DefaultMQPushConsumerImpl::start() {
 #ifndef WIN32
   /* Ignore the SIGPIPE */
@@ -235,165 +174,142 @@ void DefaultMQPushConsumerImpl::start() {
   ::sigaction(SIGPIPE, &sa, 0);
 #endif
 
-  switch (m_serviceState) {
+  switch (service_state_) {
     case CREATE_JUST: {
-      LOG_INFO_NEW("the consumer [{}] start beginning.", m_pushConsumerConfig->getGroupName());
+      LOG_INFO_NEW("the consumer [{}] start beginning.", client_config_->getGroupName());
 
-      m_serviceState = START_FAILED;
+      service_state_ = START_FAILED;
 
-      // data
       checkConfig();
 
       copySubscription();
 
-      if (messageModel() == CLUSTERING) {
-        m_pushConsumerConfig->changeInstanceNameToPID();
+      if (messageModel() == MessageModel::CLUSTERING) {
+        client_config_->changeInstanceNameToPID();
       }
 
-      // ensure m_clientInstance
+      // init client_instance_
       MQClientImpl::start();
 
-      // reset rebalance
-      m_rebalanceImpl->setConsumerGroup(m_pushConsumerConfig->getGroupName());
-      m_rebalanceImpl->setMessageModel(m_pushConsumerConfig->getMessageModel());
-      m_rebalanceImpl->setAllocateMQStrategy(m_pushConsumerConfig->getAllocateMQStrategy());
-      m_rebalanceImpl->setClientInstance(m_clientInstance.get());
-
-      m_pullAPIWrapper.reset(new PullAPIWrapper(m_clientInstance.get(), m_pushConsumerConfig->getGroupName()));
-
-      switch (m_pushConsumerConfig->getMessageModel()) {
-        case BROADCASTING:
-          m_offsetStore.reset(new LocalFileOffsetStore(m_clientInstance.get(), m_pushConsumerConfig->getGroupName()));
+      // init rebalance_impl_
+      rebalance_impl_->set_consumer_group(client_config_->getGroupName());
+      rebalance_impl_->set_message_model(
+          dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel());
+      rebalance_impl_->set_allocate_mq_strategy(
+          dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getAllocateMQStrategy());
+      rebalance_impl_->set_client_instance(client_instance_.get());
+
+      // init pull_api_wrapper_
+      pull_api_wrapper_.reset(new PullAPIWrapper(client_instance_.get(), client_config_->getGroupName()));
+      // TODO: registerFilterMessageHook
+
+      // init offset_store_
+      switch (dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel()) {
+        case MessageModel::BROADCASTING:
+          offset_store_.reset(new LocalFileOffsetStore(client_instance_.get(), client_config_->getGroupName()));
           break;
-        case CLUSTERING:
-          m_offsetStore.reset(
-              new RemoteBrokerOffsetStore(m_clientInstance.get(), m_pushConsumerConfig->getGroupName()));
+        case MessageModel::CLUSTERING:
+          offset_store_.reset(new RemoteBrokerOffsetStore(client_instance_.get(), client_config_->getGroupName()));
           break;
       }
-      m_offsetStore->load();
-
-      // checkConfig() guarantee m_pMessageListener is not nullptr
-      if (m_messageListener->getMessageListenerType() == messageListenerOrderly) {
-        LOG_INFO_NEW("start orderly consume service: {}", m_pushConsumerConfig->getGroupName());
-        m_consumeOrderly = true;
-        m_consumeService.reset(
-            new ConsumeMessageOrderlyService(this, m_pushConsumerConfig->getConsumeThreadNum(), m_messageListener));
+      offset_store_->load();
+
+      // checkConfig() guarantee message_listener_ is not nullptr
+      if (message_listener_->getMessageListenerType() == messageListenerOrderly) {
+        LOG_INFO_NEW("start orderly consume service: {}", client_config_->getGroupName());
+        consume_orderly_ = true;
+        consume_service_.reset(new ConsumeMessageOrderlyService(
+            this, dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeThreadNum(),
+            message_listener_));
       } else {
         // for backward compatible, defaultly and concurrently listeners are allocating
         // ConsumeMessageConcurrentlyService
-        LOG_INFO_NEW("start concurrently consume service: {}", m_pushConsumerConfig->getGroupName());
-        m_consumeOrderly = false;
-        m_consumeService.reset(new ConsumeMessageConcurrentlyService(this, m_pushConsumerConfig->getConsumeThreadNum(),
-                                                                     m_messageListener));
+        LOG_INFO_NEW("start concurrently consume service: {}", client_config_->getGroupName());
+        consume_orderly_ = false;
+        consume_service_.reset(new ConsumeMessageConcurrentlyService(
+            this, dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeThreadNum(),
+            message_listener_));
       }
-      m_consumeService->start();
+      consume_service_->start();
 
       // register consumer
-      bool registerOK = m_clientInstance->registerConsumer(m_pushConsumerConfig->getGroupName(), this);
+      bool registerOK = client_instance_->registerConsumer(client_config_->getGroupName(), this);
       if (!registerOK) {
-        m_serviceState = CREATE_JUST;
-        m_consumeService->shutdown();
-        THROW_MQEXCEPTION(MQClientException, "The cousumer group[" + m_pushConsumerConfig->getGroupName() +
+        service_state_ = CREATE_JUST;
+        consume_service_->shutdown();
+        THROW_MQEXCEPTION(MQClientException, "The cousumer group[" + client_config_->getGroupName() +
                                                  "] has been created before, specify another name please.",
                           -1);
       }
 
-      m_clientInstance->start();
-      LOG_INFO_NEW("the consumer [{}] start OK", m_pushConsumerConfig->getGroupName());
-      m_serviceState = RUNNING;
+      client_instance_->start();
+
+      LOG_INFO_NEW("the consumer [{}] start OK", client_config_->getGroupName());
+      service_state_ = RUNNING;
       break;
     }
     case RUNNING:
     case START_FAILED:
     case SHUTDOWN_ALREADY:
+      THROW_MQEXCEPTION(MQClientException, "The PushConsumer service state not OK, maybe started once", -1);
       break;
     default:
       break;
   }
 
   updateTopicSubscribeInfoWhenSubscriptionChanged();
-  m_clientInstance->sendHeartbeatToAllBrokerWithLock();
-  m_clientInstance->rebalanceImmediately();
-}
-
-void DefaultMQPushConsumerImpl::shutdown() {
-  switch (m_serviceState) {
-    case RUNNING: {
-      m_consumeService->shutdown();
-      persistConsumerOffset();
-      m_clientInstance->unregisterConsumer(m_pushConsumerConfig->getGroupName());
-      m_clientInstance->shutdown();
-      LOG_INFO_NEW("the consumer [{}] shutdown OK", m_pushConsumerConfig->getGroupName());
-      m_rebalanceImpl->destroy();
-      m_serviceState = SHUTDOWN_ALREADY;
-      break;
-    }
-    case CREATE_JUST:
-    case SHUTDOWN_ALREADY:
-      break;
-    default:
-      break;
-  }
-}
-
-void DefaultMQPushConsumerImpl::registerMessageListener(MQMessageListener* messageListener) {
-  if (nullptr != messageListener) {
-    m_messageListener = messageListener;
-  }
-}
-
-void DefaultMQPushConsumerImpl::registerMessageListener(MessageListenerConcurrently* messageListener) {
-  registerMessageListener(static_cast<MQMessageListener*>(messageListener));
-}
-
-void DefaultMQPushConsumerImpl::registerMessageListener(MessageListenerOrderly* messageListener) {
-  registerMessageListener(static_cast<MQMessageListener*>(messageListener));
-}
-
-MQMessageListener* DefaultMQPushConsumerImpl::getMessageListener() const {
-  return m_messageListener;
-}
-
-void DefaultMQPushConsumerImpl::subscribe(const std::string& topic, const std::string& subExpression) {
-  m_subTopics[topic] = subExpression;
+  client_instance_->sendHeartbeatToAllBrokerWithLock();
+  client_instance_->rebalanceImmediately();
 }
 
 void DefaultMQPushConsumerImpl::checkConfig() {
-  std::string groupname = m_pushConsumerConfig->getGroupName();
+  std::string groupname = client_config_->getGroupName();
 
   // check consumerGroup
   Validators::checkGroup(groupname);
 
   // consumerGroup
-  if (!groupname.compare(DEFAULT_CONSUMER_GROUP)) {
-    THROW_MQEXCEPTION(MQClientException, "consumerGroup can not equal DEFAULT_CONSUMER", -1);
+  if (DEFAULT_CONSUMER_GROUP == groupname) {
+    THROW_MQEXCEPTION(MQClientException,
+                      "consumerGroup can not equal " + DEFAULT_CONSUMER_GROUP + ", please specify another one.", -1);
+  }
+
+  if (dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel() != BROADCASTING &&
+      dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel() != CLUSTERING) {
+    THROW_MQEXCEPTION(MQClientException, "messageModel is valid", -1);
   }
 
-  if (m_pushConsumerConfig->getMessageModel() != BROADCASTING &&
-      m_pushConsumerConfig->getMessageModel() != CLUSTERING) {
-    THROW_MQEXCEPTION(MQClientException, "messageModel is valid ", -1);
+  // allocateMessageQueueStrategy
+  if (nullptr == dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getAllocateMQStrategy()) {
+    THROW_MQEXCEPTION(MQClientException, "allocateMessageQueueStrategy is null", -1);
   }
 
-  if (m_messageListener == nullptr) {
-    THROW_MQEXCEPTION(MQClientException, "messageListener is null ", -1);
+  // subscription
+  if (subscription_.empty()) {
+    THROW_MQEXCEPTION(MQClientException, "subscription is empty", -1);
+  }
+
+  // messageListener
+  if (message_listener_ == nullptr) {
+    THROW_MQEXCEPTION(MQClientException, "messageListener is null", -1);
   }
 }
 
 void DefaultMQPushConsumerImpl::copySubscription() {
-  for (const auto& it : m_subTopics) {
+  for (const auto& it : subscription_) {
     LOG_INFO_NEW("buildSubscriptionData: {}, {}", it.first, it.second);
-    SubscriptionDataPtr subscriptionData = FilterAPI::buildSubscriptionData(it.first, it.second);
-    m_rebalanceImpl->setSubscriptionData(it.first, subscriptionData);
+    SubscriptionData* subscriptionData = FilterAPI::buildSubscriptionData(it.first, it.second);
+    rebalance_impl_->setSubscriptionData(it.first, subscriptionData);
   }
 
-  switch (m_pushConsumerConfig->getMessageModel()) {
+  switch (dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel()) {
     case BROADCASTING:
       break;
     case CLUSTERING: {
       // auto subscript retry topic
-      std::string retryTopic = UtilAll::getRetryTopic(m_pushConsumerConfig->getGroupName());
-      SubscriptionDataPtr subscriptionData = FilterAPI::buildSubscriptionData(retryTopic, SUB_ALL);
-      m_rebalanceImpl->setSubscriptionData(retryTopic, subscriptionData);
+      std::string retryTopic = UtilAll::getRetryTopic(client_config_->getGroupName());
+      SubscriptionData* subscriptionData = FilterAPI::buildSubscriptionData(retryTopic, SUB_ALL);
+      rebalance_impl_->setSubscriptionData(retryTopic, subscriptionData);
       break;
     }
     default:
@@ -401,88 +317,149 @@ void DefaultMQPushConsumerImpl::copySubscription() {
   }
 }
 
-void DefaultMQPushConsumerImpl::updateTopicSubscribeInfo(const std::string& topic, std::vector<MQMessageQueue>& info) {
-  m_rebalanceImpl->setTopicSubscribeInfo(topic, info);
-}
-
 void DefaultMQPushConsumerImpl::updateTopicSubscribeInfoWhenSubscriptionChanged() {
-  auto& subTable = m_rebalanceImpl->getSubscriptionInner();
-  for (const auto& sub : subTable) {
-    bool ret = m_clientInstance->updateTopicRouteInfoFromNameServer(sub.first);
+  auto& subTable = rebalance_impl_->getSubscriptionInner();
+  for (const auto& it : subTable) {
+    const auto& topic = it.first;
+    bool ret = client_instance_->updateTopicRouteInfoFromNameServer(topic);
     if (!ret) {
-      LOG_WARN_NEW("The topic:[{}] not exist", sub.first);
+      LOG_WARN_NEW("The topic:[{}] not exist", topic);
     }
   }
 }
 
-std::string DefaultMQPushConsumerImpl::groupName() const {
-  return m_pushConsumerConfig->getGroupName();
+void DefaultMQPushConsumerImpl::shutdown() {
+  switch (service_state_) {
+    case RUNNING: {
+      consume_service_->shutdown();
+      persistConsumerOffset();
+      client_instance_->unregisterConsumer(client_config_->getGroupName());
+      client_instance_->shutdown();
+      LOG_INFO_NEW("the consumer [{}] shutdown OK", client_config_->getGroupName());
+      rebalance_impl_->destroy();
+      service_state_ = SHUTDOWN_ALREADY;
+      break;
+    }
+    case CREATE_JUST:
+    case SHUTDOWN_ALREADY:
+      break;
+    default:
+      break;
+  }
 }
 
-MessageModel DefaultMQPushConsumerImpl::messageModel() const {
-  return m_pushConsumerConfig->getMessageModel();
-};
+bool DefaultMQPushConsumerImpl::sendMessageBack(MessageExtPtr msg, int delayLevel) {
+  return sendMessageBack(msg, delayLevel, null);
+}
 
-ConsumeType DefaultMQPushConsumerImpl::consumeType() const {
-  return CONSUME_PASSIVELY;
+bool DefaultMQPushConsumerImpl::sendMessageBack(MessageExtPtr msg, int delayLevel, const std::string& brokerName) {
+  try {
+    std::string brokerAddr = brokerName.empty() ? socketAddress2String(msg->getStoreHost())
+                                                : client_instance_->findBrokerAddressInPublish(brokerName);
+
+    client_instance_->getMQClientAPIImpl()->consumerSendMessageBack(
+        brokerAddr, msg, dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getGroupName(), delayLevel,
+        5000, getMaxReconsumeTimes());
+    return true;
+  } catch (const std::exception& e) {
+    LOG_ERROR_NEW("sendMessageBack exception, group: {}, msg: {}. {}",
+                  dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getGroupName(), msg->toString(),
+                  e.what());
+  }
+  return false;
 }
 
-ConsumeFromWhere DefaultMQPushConsumerImpl::consumeFromWhere() const {
-  return m_pushConsumerConfig->getConsumeFromWhere();
+void DefaultMQPushConsumerImpl::fetchSubscribeMessageQueues(const std::string& topic,
+                                                            std::vector<MQMessageQueue>& mqs) {
+  mqs.clear();
+  try {
+    client_instance_->getMQAdminImpl()->fetchSubscribeMessageQueues(topic, mqs);
+  } catch (MQException& e) {
+    LOG_ERROR_NEW("{}", e.what());
+  }
 }
 
-std::vector<SubscriptionData> DefaultMQPushConsumerImpl::subscriptions() const {
-  std::vector<SubscriptionData> result;
-  auto& subTable = m_rebalanceImpl->getSubscriptionInner();
-  for (const auto& it : subTable) {
-    result.push_back(*(it.second));
+void DefaultMQPushConsumerImpl::registerMessageListener(MQMessageListener* messageListener) {
+  if (nullptr != messageListener) {
+    message_listener_ = messageListener;
   }
-  return result;
+}
+
+void DefaultMQPushConsumerImpl::registerMessageListener(MessageListenerConcurrently* messageListener) {
+  registerMessageListener(static_cast<MQMessageListener*>(messageListener));
+}
+
+void DefaultMQPushConsumerImpl::registerMessageListener(MessageListenerOrderly* messageListener) {
+  registerMessageListener(static_cast<MQMessageListener*>(messageListener));
+}
+
+MQMessageListener* DefaultMQPushConsumerImpl::getMessageListener() const {
+  return message_listener_;
+}
+
+void DefaultMQPushConsumerImpl::subscribe(const std::string& topic, const std::string& subExpression) {
+  // TODO: change substation after start
+  subscription_[topic] = subExpression;
 }
 
 void DefaultMQPushConsumerImpl::suspend() {
-  m_pause = true;
-  LOG_INFO_NEW("suspend this consumer, {}", m_pushConsumerConfig->getGroupName());
+  pause_ = true;
+  LOG_INFO_NEW("suspend this consumer, {}", client_config_->getGroupName());
 }
 
 void DefaultMQPushConsumerImpl::resume() {
-  m_pause = false;
+  pause_ = false;
   doRebalance();
-  LOG_INFO_NEW("resume this consumer, {}", m_pushConsumerConfig->getGroupName());
+  LOG_INFO_NEW("resume this consumer, {}", client_config_->getGroupName());
 }
 
-bool DefaultMQPushConsumerImpl::isPause() {
-  return m_pause;
+void DefaultMQPushConsumerImpl::doRebalance() {
+  if (!pause_) {
+    rebalance_impl_->doRebalance(isConsumeOrderly());
+  }
 }
 
-void DefaultMQPushConsumerImpl::setPause(bool pause) {
-  m_pause = pause;
+void DefaultMQPushConsumerImpl::persistConsumerOffset() {
+  if (isServiceStateOk()) {
+    std::vector<MQMessageQueue> mqs = rebalance_impl_->getAllocatedMQ();
+    if (dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel() == BROADCASTING) {
+      offset_store_->persistAll(mqs);
+    } else {
+      for (const auto& mq : mqs) {
+        offset_store_->persist(mq);
+      }
+    }
+  }
+}
+
+void DefaultMQPushConsumerImpl::updateTopicSubscribeInfo(const std::string& topic, std::vector<MQMessageQueue>& info) {
+  rebalance_impl_->setTopicSubscribeInfo(topic, info);
 }
 
 void DefaultMQPushConsumerImpl::updateConsumeOffset(const MQMessageQueue& mq, int64_t offset) {
   if (offset >= 0) {
-    m_offsetStore->updateOffset(mq, offset, false);
+    offset_store_->updateOffset(mq, offset, false);
   } else {
     LOG_ERROR_NEW("updateConsumeOffset of mq:{} error", mq.toString());
   }
 }
 
 void DefaultMQPushConsumerImpl::correctTagsOffset(PullRequestPtr pullRequest) {
-  if (0L == pullRequest->getProcessQueue()->getCacheMsgCount()) {
-    m_offsetStore->updateOffset(pullRequest->getMessageQueue(), pullRequest->getNextOffset(), true);
+  if (0L == pullRequest->process_queue()->getCacheMsgCount()) {
+    offset_store_->updateOffset(pullRequest->message_queue(), pullRequest->next_offset(), true);
   }
 }
 
 void DefaultMQPushConsumerImpl::executePullRequestLater(PullRequestPtr pullRequest, long timeDelay) {
-  m_clientInstance->getPullMessageService()->executePullRequestLater(pullRequest, timeDelay);
+  client_instance_->getPullMessageService()->executePullRequestLater(pullRequest, timeDelay);
 }
 
 void DefaultMQPushConsumerImpl::executePullRequestImmediately(PullRequestPtr pullRequest) {
-  m_clientInstance->getPullMessageService()->executePullRequestImmediately(pullRequest);
+  client_instance_->getPullMessageService()->executePullRequestImmediately(pullRequest);
 }
 
 void DefaultMQPushConsumerImpl::executeTaskLater(const handler_type& task, long timeDelay) {
-  m_clientInstance->getPullMessageService()->executeTaskLater(task, timeDelay);
+  client_instance_->getPullMessageService()->executeTaskLater(task, timeDelay);
 }
 
 void DefaultMQPushConsumerImpl::pullMessage(PullRequestPtr pullRequest) {
@@ -491,26 +468,27 @@ void DefaultMQPushConsumerImpl::pullMessage(PullRequestPtr pullRequest) {
     return;
   }
 
-  auto processQueue = pullRequest->getProcessQueue();
-  if (processQueue->isDropped()) {
+  auto processQueue = pullRequest->process_queue();
+  if (processQueue->dropped()) {
     LOG_WARN_NEW("the pull request[{}] is dropped.", pullRequest->toString());
     return;
   }
 
-  processQueue->setLastPullTimestamp(UtilAll::currentTimeMillis());
+  processQueue->set_last_pull_timestamp(UtilAll::currentTimeMillis());
 
   int cachedMessageCount = processQueue->getCacheMsgCount();
-  if (cachedMessageCount > m_pushConsumerConfig->getMaxCacheMsgSizePerQueue()) {
+  if (cachedMessageCount >
+      dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMaxCacheMsgSizePerQueue()) {
     // too many message in cache, wait to process
     executePullRequestLater(pullRequest, 1000);
     return;
   }
 
   if (isConsumeOrderly()) {
-    if (processQueue->isLocked()) {
-      if (!pullRequest->isLockedFirst()) {
-        const auto offset = m_rebalanceImpl->computePullFromWhere(pullRequest->getMessageQueue());
-        bool brokerBusy = offset < pullRequest->getNextOffset();
+    if (processQueue->locked()) {
+      if (!pullRequest->locked_first()) {
+        const auto offset = rebalance_impl_->computePullFromWhere(pullRequest->message_queue());
+        bool brokerBusy = offset < pullRequest->next_offset();
         LOG_INFO_NEW(
             "the first time to pull message, so fix offset from broker. pullRequest: {} NewOffset: {} brokerBusy: {}",
             pullRequest->toString(), offset, UtilAll::to_string(brokerBusy));
@@ -521,34 +499,38 @@ void DefaultMQPushConsumerImpl::pullMessage(PullRequestPtr pullRequest) {
               pullRequest->toString(), offset);
         }
 
-        pullRequest->setLockedFirst(true);
-        pullRequest->setNextOffset(offset);
+        pullRequest->set_locked_first(true);
+        pullRequest->set_next_offset(offset);
       }
     } else {
-      executePullRequestLater(pullRequest, m_pushConsumerConfig->getPullTimeDelayMillsWhenException());
+      executePullRequestLater(
+          pullRequest,
+          dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getPullTimeDelayMillsWhenException());
       LOG_INFO_NEW("pull message later because not locked in broker, {}", pullRequest->toString());
       return;
     }
   }
 
-  const auto& messageQueue = pullRequest->getMessageQueue();
-  SubscriptionDataPtr subscriptionData = m_rebalanceImpl->getSubscriptionData(messageQueue.getTopic());
+  const auto& messageQueue = pullRequest->message_queue();
+  SubscriptionData* subscriptionData = rebalance_impl_->getSubscriptionData(messageQueue.topic());
   if (nullptr == subscriptionData) {
-    executePullRequestLater(pullRequest, m_pushConsumerConfig->getPullTimeDelayMillsWhenException());
+    executePullRequestLater(
+        pullRequest,
+        dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getPullTimeDelayMillsWhenException());
     LOG_WARN_NEW("find the consumer's subscription failed, {}", pullRequest->toString());
     return;
   }
 
   bool commitOffsetEnable = false;
   int64_t commitOffsetValue = 0;
-  if (CLUSTERING == m_pushConsumerConfig->getMessageModel()) {
-    commitOffsetValue = m_offsetStore->readOffset(messageQueue, READ_FROM_MEMORY);
+  if (CLUSTERING == dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel()) {
+    commitOffsetValue = offset_store_->readOffset(messageQueue, READ_FROM_MEMORY);
     if (commitOffsetValue > 0) {
       commitOffsetEnable = true;
     }
   }
 
-  const auto& subExpression = subscriptionData->getSubString();
+  const auto& subExpression = subscriptionData->sub_string();
 
   int sysFlag = PullSysFlag::buildSysFlag(commitOffsetEnable,      // commitOffset
                                           true,                    // suspend
@@ -557,20 +539,23 @@ void DefaultMQPushConsumerImpl::pullMessage(PullRequestPtr pullRequest) {
 
   try {
     auto* callback = new AsyncPullCallback(shared_from_this(), pullRequest, subscriptionData);
-    m_pullAPIWrapper->pullKernelImpl(messageQueue,                                 // 1
-                                     subExpression,                                // 2
-                                     subscriptionData->getSubVersion(),            // 3
-                                     pullRequest->getNextOffset(),                 // 4
-                                     32,                                           // 5
-                                     sysFlag,                                      // 6
-                                     commitOffsetValue,                            // 7
-                                     1000 * 15,                                    // 8
-                                     m_pushConsumerConfig->getAsyncPullTimeout(),  // 9
-                                     CommunicationMode::ASYNC,                     // 10
-                                     callback);                                    // 11
+    pull_api_wrapper_->pullKernelImpl(
+        messageQueue,                                                                             // 1
+        subExpression,                                                                            // 2
+        subscriptionData->sub_version(),                                                          // 3
+        pullRequest->next_offset(),                                                               // 4
+        32,                                                                                       // 5
+        sysFlag,                                                                                  // 6
+        commitOffsetValue,                                                                        // 7
+        1000 * 15,                                                                                // 8
+        dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getAsyncPullTimeout(),  // 9
+        CommunicationMode::ASYNC,                                                                 // 10
+        callback);                                                                                // 11
   } catch (MQException& e) {
     LOG_ERROR_NEW("pullKernelImpl exception: {}", e.what());
-    executePullRequestLater(pullRequest, m_pushConsumerConfig->getPullTimeDelayMillsWhenException());
+    executePullRequestLater(
+        pullRequest,
+        dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getPullTimeDelayMillsWhenException());
   }
 }
 
@@ -585,25 +570,60 @@ void DefaultMQPushConsumerImpl::resetRetryTopic(const std::vector<MessageExtPtr>
   }
 }
 
+int DefaultMQPushConsumerImpl::getMaxReconsumeTimes() {
+  // default reconsume times: 16
+  if (dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMaxReconsumeTimes() == -1) {
+    return 16;
+  } else {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMaxReconsumeTimes();
+  }
+}
+
+std::string DefaultMQPushConsumerImpl::groupName() const {
+  return client_config_->getGroupName();
+}
+
+MessageModel DefaultMQPushConsumerImpl::messageModel() const {
+  return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getMessageModel();
+};
+
+ConsumeType DefaultMQPushConsumerImpl::consumeType() const {
+  return CONSUME_PASSIVELY;
+}
+
+ConsumeFromWhere DefaultMQPushConsumerImpl::consumeFromWhere() const {
+  return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeFromWhere();
+}
+
+std::vector<SubscriptionData> DefaultMQPushConsumerImpl::subscriptions() const {
+  std::vector<SubscriptionData> result;
+  auto& subTable = rebalance_impl_->getSubscriptionInner();
+  for (const auto& it : subTable) {
+    result.push_back(*(it.second));
+  }
+  return result;
+}
+
 ConsumerRunningInfo* DefaultMQPushConsumerImpl::consumerRunningInfo() {
   auto* info = new ConsumerRunningInfo();
 
-  info->setProperty(ConsumerRunningInfo::PROP_CONSUME_ORDERLY, UtilAll::to_string(m_consumeOrderly));
-  info->setProperty(ConsumerRunningInfo::PROP_THREADPOOL_CORE_SIZE,
-                    UtilAll::to_string(m_pushConsumerConfig->getConsumeThreadNum()));
-  info->setProperty(ConsumerRunningInfo::PROP_CONSUMER_START_TIMESTAMP, UtilAll::to_string(m_startTime));
+  info->setProperty(ConsumerRunningInfo::PROP_CONSUME_ORDERLY, UtilAll::to_string(consume_orderly_));
+  info->setProperty(
+      ConsumerRunningInfo::PROP_THREADPOOL_CORE_SIZE,
+      UtilAll::to_string(dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get())->getConsumeThreadNum()));
+  info->setProperty(ConsumerRunningInfo::PROP_CONSUMER_START_TIMESTAMP, UtilAll::to_string(start_time_));
 
   auto subSet = subscriptions();
   info->setSubscriptionSet(subSet);
 
-  auto processQueueTable = m_rebalanceImpl->getProcessQueueTable();
+  auto processQueueTable = rebalance_impl_->getProcessQueueTable();
 
   for (const auto& it : processQueueTable) {
     const auto& mq = it.first;
     const auto& pq = it.second;
 
     ProcessQueueInfo pqinfo;
-    pqinfo.setCommitOffset(m_offsetStore->readOffset(mq, MEMORY_FIRST_THEN_STORE));
+    pqinfo.setCommitOffset(offset_store_->readOffset(mq, MEMORY_FIRST_THEN_STORE));
     pq->fillProcessQueueInfo(pqinfo);
     info->setMqTable(mq, pqinfo);
   }
diff --git a/src/consumer/DefaultMQPushConsumerImpl.h b/src/consumer/DefaultMQPushConsumerImpl.h
index 95563a2..e6bee69 100755
--- a/src/consumer/DefaultMQPushConsumerImpl.h
+++ b/src/consumer/DefaultMQPushConsumerImpl.h
@@ -14,27 +14,27 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __DEFAULT_MQ_PUSH_CONSUMER_IMPL_H__
-#define __DEFAULT_MQ_PUSH_CONSUMER_IMPL_H__
+#ifndef ROCKETMQ_CONXUMER_DEFAULTMQPUSHCONSUMERIMPL_H_
+#define ROCKETMQ_CONXUMER_DEFAULTMQPUSHCONSUMERIMPL_H_
 
 #include <memory>
 #include <string>
 #include <thread>
 
+#include "concurrent/executor.hpp"
 #include "DefaultMQPushConsumer.h"
 #include "MQClientImpl.h"
 #include "MQConsumerInner.h"
 #include "PullRequest.h"
-#include "concurrent/executor.hpp"
 
 namespace rocketmq {
 
-class RebalanceImpl;
-class SubscriptionData;
+class AsyncPullCallback;
+class ConsumeMsgService;
 class OffsetStore;
 class PullAPIWrapper;
-class ConsumeMsgService;
-class AsyncPullCallback;
+class RebalanceImpl;
+class SubscriptionData;
 
 class DefaultMQPushConsumerImpl;
 typedef std::shared_ptr<DefaultMQPushConsumerImpl> DefaultMQPushConsumerImplPtr;
@@ -44,6 +44,10 @@ class DefaultMQPushConsumerImpl : public std::enable_shared_from_this<DefaultMQP
                                   public MQClientImpl,
                                   public MQConsumerInner {
  public:
+  /**
+   * create() - Factory method for DefaultMQPushConsumerImpl, used to ensure that all objects of
+   * DefaultMQPushConsumerImpl are managed by std::share_ptr
+   */
   static DefaultMQPushConsumerImplPtr create(DefaultMQPushConsumerConfigPtr config, RPCHookPtr rpcHook = nullptr) {
     if (nullptr == rpcHook) {
       return DefaultMQPushConsumerImplPtr(new DefaultMQPushConsumerImpl(config));
@@ -90,12 +94,10 @@ class DefaultMQPushConsumerImpl : public std::enable_shared_from_this<DefaultMQP
   void doRebalance() override;
   void persistConsumerOffset() override;
   void updateTopicSubscribeInfo(const std::string& topic, std::vector<MQMessageQueue>& info) override;
+
   ConsumerRunningInfo* consumerRunningInfo() override;
 
  public:
-  bool isPause();
-  void setPause(bool pause);
-
   void updateConsumeOffset(const MQMessageQueue& mq, int64_t offset);
   void correctTagsOffset(PullRequestPtr pullRequest);
 
@@ -107,49 +109,52 @@ class DefaultMQPushConsumerImpl : public std::enable_shared_from_this<DefaultMQP
 
   void resetRetryTopic(const std::vector<MessageExtPtr>& msgs, const std::string& consumerGroup);
 
+ private:
+  void checkConfig();
+  void copySubscription();
+  void updateTopicSubscribeInfoWhenSubscriptionChanged();
+
  public:
-  bool isConsumeOrderly() { return m_consumeOrderly; }
+  int getMaxReconsumeTimes();
+
+  inline bool isPause() const { return pause_; };
+  inline void setPause(bool pause) { pause_ = pause; }
 
-  RebalanceImpl* getRebalanceImpl() const { return m_rebalanceImpl.get(); }
+  inline bool isConsumeOrderly() { return consume_orderly_; }
 
-  PullAPIWrapper* getPullAPIWrapper() const { return m_pullAPIWrapper.get(); }
+  inline RebalanceImpl* getRebalanceImpl() const { return rebalance_impl_.get(); }
 
-  OffsetStore* getOffsetStore() const { return m_offsetStore.get(); }
+  inline PullAPIWrapper* getPullAPIWrapper() const { return pull_api_wrapper_.get(); }
 
-  ConsumeMsgService* getConsumerMsgService() const { return m_consumeService.get(); }
+  inline OffsetStore* getOffsetStore() const { return offset_store_.get(); }
 
-  MessageListenerType getMessageListenerType() const {
-    if (nullptr != m_messageListener) {
-      return m_messageListener->getMessageListenerType();
+  inline ConsumeMsgService* getConsumerMsgService() const { return consume_service_.get(); }
+
+  inline MessageListenerType getMessageListenerType() const {
+    if (nullptr != message_listener_) {
+      return message_listener_->getMessageListenerType();
     }
     return messageListenerDefaultly;
   }
 
-  DefaultMQPushConsumerConfig* getDefaultMQPushConsumerConfig() { return m_pushConsumerConfig.get(); }
-
- private:
-  void checkConfig();
-  void copySubscription();
-  void updateTopicSubscribeInfoWhenSubscriptionChanged();
-
-  int getMaxReconsumeTimes();
+  inline DefaultMQPushConsumerConfig* getDefaultMQPushConsumerConfig() {
+    return dynamic_cast<DefaultMQPushConsumerConfig*>(client_config_.get());
+  }
 
  private:
-  DefaultMQPushConsumerConfigPtr m_pushConsumerConfig;
-
-  uint64_t m_startTime;
+  uint64_t start_time_;
 
-  volatile bool m_pause;
-  bool m_consumeOrderly;
+  volatile bool pause_;
+  bool consume_orderly_;
 
-  std::map<std::string, std::string> m_subTopics;
-  std::unique_ptr<RebalanceImpl> m_rebalanceImpl;
-  std::unique_ptr<PullAPIWrapper> m_pullAPIWrapper;
-  std::unique_ptr<OffsetStore> m_offsetStore;
-  std::unique_ptr<ConsumeMsgService> m_consumeService;
-  MQMessageListener* m_messageListener;
+  std::map<std::string, std::string> subscription_;
+  std::unique_ptr<RebalanceImpl> rebalance_impl_;
+  std::unique_ptr<PullAPIWrapper> pull_api_wrapper_;
+  std::unique_ptr<OffsetStore> offset_store_;
+  std::unique_ptr<ConsumeMsgService> consume_service_;
+  MQMessageListener* message_listener_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __DEFAULT_MQ_PUSH_CONSUMER_IMPL_H__
+#endif  // ROCKETMQ_CONXUMER_DEFAULTMQPUSHCONSUMERIMPL_H_
diff --git a/src/consumer/FindBrokerResult.h b/src/consumer/FindBrokerResult.hpp
similarity index 61%
rename from src/consumer/FindBrokerResult.h
rename to src/consumer/FindBrokerResult.hpp
index d1eaa13..0683e48 100644
--- a/src/consumer/FindBrokerResult.h
+++ b/src/consumer/FindBrokerResult.hpp
@@ -14,19 +14,28 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __FIND_BROKER_RESULT_H__
-#define __FIND_BROKER_RESULT_H__
+#ifndef ROCKETMQ_CONSUMER_FINDBROKERRESULT_HPP_
+#define ROCKETMQ_CONSUMER_FINDBROKERRESULT_HPP_
 
-namespace rocketmq {
+#include <string>  // std::string
 
-struct FindBrokerResult {
-  FindBrokerResult(const std::string& sbrokerAddr, bool bslave) : brokerAddr(sbrokerAddr), slave(bslave) {}
+namespace rocketmq {
 
+class FindBrokerResult {
  public:
-  std::string brokerAddr;
-  bool slave;
+  FindBrokerResult(const std::string& sbrokerAddr, bool bslave) : broker_addr_(sbrokerAddr), slave_(bslave) {}
+
+  inline const std::string& broker_addr() const { return broker_addr_; }
+  inline void set_borker_addr(const std::string& broker_addr) { broker_addr_ = broker_addr; }
+
+  inline bool slave() const { return slave_; }
+  inline void set_slave(bool slave) { slave_ = slave; }
+
+ private:
+  std::string broker_addr_;
+  bool slave_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __FIND_BROKER_RESULT_H__
+#endif  // ROCKETMQ_CONSUMER_FINDBROKERRESULT_HPP_
diff --git a/src/consumer/LocalFileOffsetStore.cpp b/src/consumer/LocalFileOffsetStore.cpp
new file mode 100644
index 0000000..b2da588
--- /dev/null
+++ b/src/consumer/LocalFileOffsetStore.cpp
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "LocalFileOffsetStore.h"
+
+#include <fstream>
+
+#include "Logging.h"
+#include "MQClientInstance.h"
+#include "MessageQueue.h"
+#include "UtilAll.h"
+
+namespace rocketmq {
+
+LocalFileOffsetStore::LocalFileOffsetStore(MQClientInstance* instance, const std::string& groupName)
+    : client_instance_(instance), group_name_(groupName) {
+  LOG_INFO("new LocalFileOffsetStore");
+
+  std::string clientId = instance->getClientId();
+  std::string homeDir(UtilAll::getHomeDirectory());
+  std::string storeDir =
+      homeDir + FILE_SEPARATOR + ".rocketmq_offsets" + FILE_SEPARATOR + clientId + FILE_SEPARATOR + groupName;
+  store_path_ = storeDir + FILE_SEPARATOR + "offsets.json";
+
+  if (!UtilAll::existDirectory(storeDir)) {
+    UtilAll::createDirectory(storeDir);
+    if (!UtilAll::existDirectory(storeDir)) {
+      LOG_ERROR("create offset store dir:%s error", storeDir.c_str());
+      std::string errorMsg("create offset store dir failed: ");
+      errorMsg.append(storeDir);
+      THROW_MQEXCEPTION(MQClientException, errorMsg, -1);
+    }
+  }
+}
+
+LocalFileOffsetStore::~LocalFileOffsetStore() {
+  client_instance_ = nullptr;
+  offset_table_.clear();
+}
+
+void LocalFileOffsetStore::load() {
+  auto offsetTable = readLocalOffset();
+  if (!offsetTable.empty()) {
+    // update offsetTable
+    {
+      std::lock_guard<std::mutex> lock(lock_);
+      offset_table_ = offsetTable;
+    }
+
+    for (const auto& it : offsetTable) {
+      const auto& mq = it.first;
+      const auto offset = it.second;
+      LOG_INFO_NEW("load consumer's offset, {} {} {}", group_name_, mq.toString(), offset);
+    }
+  }
+}
+
+void LocalFileOffsetStore::updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) {
+  std::lock_guard<std::mutex> lock(lock_);
+  offset_table_[mq] = offset;
+}
+
+int64_t LocalFileOffsetStore::readOffset(const MQMessageQueue& mq, ReadOffsetType type) {
+  switch (type) {
+    case MEMORY_FIRST_THEN_STORE:
+    case READ_FROM_MEMORY: {
+      std::lock_guard<std::mutex> lock(lock_);
+      const auto& it = offset_table_.find(mq);
+      if (it != offset_table_.end()) {
+        return it->second;
+      } else if (READ_FROM_MEMORY == type) {
+        return -1;
+      }
+    } break;
+    case READ_FROM_STORE: {
+      auto offsetTable = readLocalOffset();
+      if (!offsetTable.empty()) {
+        const auto& it = offsetTable.find(mq);
+        if (it != offsetTable.end()) {
+          auto offset = it->second;
+          updateOffset(mq, offset, false);
+          return offset;
+        }
+      }
+    } break;
+    default:
+      break;
+  }
+  LOG_ERROR("can not readOffset from offsetStore.json, maybe first time consumation");
+  return -1;
+}
+
+void LocalFileOffsetStore::persist(const MQMessageQueue& mq) {}
+
+void LocalFileOffsetStore::persistAll(const std::vector<MQMessageQueue>& mqs) {
+  if (mqs.empty()) {
+    return;
+  }
+
+  std::map<MQMessageQueue, int64_t> offsetTable;
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    offsetTable = offset_table_;
+  }
+
+  Json::Value root(Json::objectValue);
+  Json::Value jOffsetTable(Json::objectValue);
+  for (const auto& mq : mqs) {
+    const auto& it = offsetTable.find(mq);
+    if (it != offsetTable.end()) {
+      std::string strMQ = RemotingSerializable::toJson(toJson(mq));
+      jOffsetTable[strMQ] = Json::Value((Json::Int64)it->second);
+    }
+  }
+  root["offsetTable"] = jOffsetTable;
+
+  std::lock_guard<std::mutex> lock2(file_mutex_);
+  std::string storePathTmp = store_path_ + ".tmp";
+  std::ofstream ofstrm(storePathTmp, std::ios::binary | std::ios::out);
+  if (ofstrm.is_open()) {
+    try {
+      RemotingSerializable::toJson(root, ofstrm, true);
+    } catch (std::exception& e) {
+      THROW_MQEXCEPTION(MQClientException, "persistAll failed", -1);
+    }
+
+    if (!UtilAll::ReplaceFile(store_path_, store_path_ + ".bak") || !UtilAll::ReplaceFile(storePathTmp, store_path_)) {
+      LOG_ERROR("could not rename file: %s", strerror(errno));
+    }
+  }
+}
+
+void LocalFileOffsetStore::removeOffset(const MQMessageQueue& mq) {}
+
+std::map<MQMessageQueue, int64_t> LocalFileOffsetStore::readLocalOffset() {
+  std::lock_guard<std::mutex> lock(file_mutex_);
+  std::ifstream ifstrm(store_path_, std::ios::binary | std::ios::in);
+  if (ifstrm.is_open() && !ifstrm.eof()) {
+    try {
+      Json::Value root = RemotingSerializable::fromJson(ifstrm);
+      std::map<MQMessageQueue, int64_t> offsetTable;
+      auto& jOffsetTable = root["offsetTable"];
+      for (auto& strMQ : jOffsetTable.getMemberNames()) {
+        auto& offset = jOffsetTable[strMQ];
+        Json::Value jMQ = RemotingSerializable::fromJson(strMQ);
+        MQMessageQueue mq(jMQ["topic"].asString(), jMQ["brokerName"].asString(), jMQ["queueId"].asInt());
+        offsetTable.emplace(std::move(mq), offset.asInt64());
+      }
+      return offsetTable;
+    } catch (std::exception& e) {
+      // ...
+    }
+  }
+  return readLocalOffsetBak();
+}
+
+std::map<MQMessageQueue, int64_t> LocalFileOffsetStore::readLocalOffsetBak() {
+  std::map<MQMessageQueue, int64_t> offsetTable;
+  std::ifstream ifstrm(store_path_ + ".bak", std::ios::binary | std::ios::in);
+  if (ifstrm.is_open()) {
+    if (!ifstrm.eof()) {
+      try {
+        Json::Value root = RemotingSerializable::fromJson(ifstrm);
+        auto& jOffsetTable = root["offsetTable"];
+        for (auto& strMQ : jOffsetTable.getMemberNames()) {
+          auto& offset = jOffsetTable[strMQ];
+          Json::Value jMQ = RemotingSerializable::fromJson(strMQ);
+          MQMessageQueue mq(jMQ["topic"].asString(), jMQ["brokerName"].asString(), jMQ["queueId"].asInt());
+          offsetTable.emplace(std::move(mq), offset.asInt64());
+        }
+      } catch (const std::exception& e) {
+        LOG_WARN_NEW("readLocalOffset Exception {}", e.what());
+        THROW_MQEXCEPTION(MQClientException, "readLocalOffset Exception", -1);
+      }
+    }
+  }
+  return offsetTable;
+}
+
+}  // namespace rocketmq
diff --git a/src/consumer/LocalFileOffsetStore.h b/src/consumer/LocalFileOffsetStore.h
new file mode 100644
index 0000000..c517fb4
--- /dev/null
+++ b/src/consumer/LocalFileOffsetStore.h
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ROCKETMQ_CONSUMER_LOCALFILEOFFSETSTORE_H_
+#define ROCKETMQ_CONSUMER_LOCALFILEOFFSETSTORE_H_
+
+#include <map>    // std::map
+#include <mutex>  // std::mutex
+
+#include "MQClientInstance.h"
+#include "OffsetStore.h"
+
+namespace rocketmq {
+
+class LocalFileOffsetStore : public OffsetStore {
+ public:
+  LocalFileOffsetStore(MQClientInstance* instance, const std::string& groupName);
+  virtual ~LocalFileOffsetStore();
+
+  void load() override;
+  void updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) override;
+  int64_t readOffset(const MQMessageQueue& mq, ReadOffsetType type) override;
+  void persist(const MQMessageQueue& mq) override;
+  void persistAll(const std::vector<MQMessageQueue>& mq) override;
+  void removeOffset(const MQMessageQueue& mq) override;
+
+ private:
+  std::map<MQMessageQueue, int64_t> readLocalOffset();
+  std::map<MQMessageQueue, int64_t> readLocalOffsetBak();
+
+ private:
+  MQClientInstance* client_instance_;
+  std::string group_name_;
+
+  std::map<MQMessageQueue, int64_t> offset_table_;
+  std::mutex lock_;
+
+  std::string store_path_;
+  std::mutex file_mutex_;
+};
+
+}  // namespace rocketmq
+
+#endif  // ROCKETMQ_CONSUMER_LOCALFILEOFFSETSTORE_H_
diff --git a/src/consumer/MQConsumerInner.h b/src/consumer/MQConsumerInner.h
index 2daf98e..31a126b 100644
--- a/src/consumer/MQConsumerInner.h
+++ b/src/consumer/MQConsumerInner.h
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MQ_CONSUMER_INNER_H__
-#define __MQ_CONSUMER_INNER_H__
+#ifndef ROCKETMQ_CONSUMER_MQCONSUMERINNER_H_
+#define ROCKETMQ_CONSUMER_MQCONSUMERINNER_H_
 
 #include <string>
 #include <vector>
@@ -41,9 +41,10 @@ class MQConsumerInner {
   virtual void doRebalance() = 0;
   virtual void persistConsumerOffset() = 0;
   virtual void updateTopicSubscribeInfo(const std::string& topic, std::vector<MQMessageQueue>& info) = 0;
+
   virtual ConsumerRunningInfo* consumerRunningInfo() = 0;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MQ_CONSUMER_INNER_H__
+#endif  // ROCKETMQ_CONSUMER_MQCONSUMERINNER_H_
diff --git a/src/consumer/MessageQueueLock.hpp b/src/consumer/MessageQueueLock.hpp
index e43fab7..acdcd9d 100644
--- a/src/consumer/MessageQueueLock.hpp
+++ b/src/consumer/MessageQueueLock.hpp
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __MESSAGE_QUEUE_LOCK__
-#define __MESSAGE_QUEUE_LOCK__
+#ifndef ROCKETMQ_CONSUMER_MESSAGEQUEUELOCK_HPP_
+#define ROCKETMQ_CONSUMER_MESSAGEQUEUELOCK_HPP_
 
 #include <map>
 #include <memory>
@@ -31,20 +31,20 @@ namespace rocketmq {
 class MessageQueueLock {
  public:
   std::shared_ptr<std::mutex> fetchLockObject(const MQMessageQueue& mq) {
-    std::lock_guard<std::mutex> lock(m_mqLockTableMutex);
-    const auto& it = m_mqLockTable.find(mq);
-    if (it != m_mqLockTable.end()) {
+    std::lock_guard<std::mutex> lock(mq_lock_table_mutex_);
+    const auto& it = mq_lock_table_.find(mq);
+    if (it != mq_lock_table_.end()) {
       return it->second;
     } else {
-      return m_mqLockTable[mq] = std::make_shared<std::mutex>();
+      return mq_lock_table_[mq] = std::make_shared<std::mutex>();
     }
   }
 
  private:
-  std::map<MQMessageQueue, std::shared_ptr<std::mutex>> m_mqLockTable;
-  std::mutex m_mqLockTableMutex;
+  std::map<MQMessageQueue, std::shared_ptr<std::mutex>> mq_lock_table_;
+  std::mutex mq_lock_table_mutex_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __MESSAGE_QUEUE_LOCK__
+#endif  // ROCKETMQ_CONSUMER_MESSAGEQUEUELOCK_HPP_
diff --git a/src/consumer/OffsetStore.cpp b/src/consumer/OffsetStore.cpp
deleted file mode 100644
index 55305cf..0000000
--- a/src/consumer/OffsetStore.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "OffsetStore.h"
-
-#include <fstream>
-
-#include "Logging.h"
-#include "MQClientAPIImpl.h"
-#include "MQClientInstance.h"
-#include "MessageQueue.h"
-#include "UtilAll.h"
-
-namespace rocketmq {
-
-//######################################
-// LocalFileOffsetStore
-//######################################
-
-LocalFileOffsetStore::LocalFileOffsetStore(MQClientInstance* instance, const std::string& groupName)
-    : m_clientInstance(instance), m_groupName(groupName) {
-  LOG_INFO("new LocalFileOffsetStore");
-
-  std::string clientId = instance->getClientId();
-  std::string homeDir(UtilAll::getHomeDirectory());
-  std::string storeDir =
-      homeDir + FILE_SEPARATOR + ".rocketmq_offsets" + FILE_SEPARATOR + clientId + FILE_SEPARATOR + groupName;
-  m_storePath = storeDir + FILE_SEPARATOR + "offsets.json";
-
-  if (!UtilAll::existDirectory(storeDir)) {
-    UtilAll::createDirectory(storeDir);
-    if (!UtilAll::existDirectory(storeDir)) {
-      LOG_ERROR("create offset store dir:%s error", storeDir.c_str());
-      std::string errorMsg("create offset store dir failed: ");
-      errorMsg.append(storeDir);
-      THROW_MQEXCEPTION(MQClientException, errorMsg, -1);
-    }
-  }
-}
-
-LocalFileOffsetStore::~LocalFileOffsetStore() {
-  m_clientInstance = nullptr;
-  m_offsetTable.clear();
-}
-
-void LocalFileOffsetStore::load() {
-  auto offsetTable = readLocalOffset();
-  if (!offsetTable.empty()) {
-    // update offsetTable
-    {
-      std::lock_guard<std::mutex> lock(m_lock);
-      m_offsetTable = offsetTable;
-    }
-
-    for (const auto& it : offsetTable) {
-      const auto& mq = it.first;
-      const auto offset = it.second;
-      LOG_INFO_NEW("load consumer's offset, {} {} {}", m_groupName, mq.toString(), offset);
-    }
-  }
-}
-
-void LocalFileOffsetStore::updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) {
-  std::lock_guard<std::mutex> lock(m_lock);
-  m_offsetTable[mq] = offset;
-}
-
-int64_t LocalFileOffsetStore::readOffset(const MQMessageQueue& mq, ReadOffsetType type) {
-  switch (type) {
-    case MEMORY_FIRST_THEN_STORE:
-    case READ_FROM_MEMORY: {
-      std::lock_guard<std::mutex> lock(m_lock);
-      const auto& it = m_offsetTable.find(mq);
-      if (it != m_offsetTable.end()) {
-        return it->second;
-      } else if (READ_FROM_MEMORY == type) {
-        return -1;
-      }
-    } break;
-    case READ_FROM_STORE: {
-      auto offsetTable = readLocalOffset();
-      if (!offsetTable.empty()) {
-        const auto& it = offsetTable.find(mq);
-        if (it != offsetTable.end()) {
-          auto offset = it->second;
-          updateOffset(mq, offset, false);
-          return offset;
-        }
-      }
-    } break;
-    default:
-      break;
-  }
-  LOG_ERROR("can not readOffset from offsetStore.json, maybe first time consumation");
-  return -1;
-}
-
-void LocalFileOffsetStore::persist(const MQMessageQueue& mq) {}
-
-void LocalFileOffsetStore::persistAll(const std::vector<MQMessageQueue>& mqs) {
-  if (mqs.empty()) {
-    return;
-  }
-
-  std::map<MQMessageQueue, int64_t> offsetTable;
-  {
-    std::lock_guard<std::mutex> lock(m_lock);
-    offsetTable = m_offsetTable;
-  }
-
-  Json::Value root(Json::objectValue);
-  Json::Value jOffsetTable(Json::objectValue);
-  for (const auto& mq : mqs) {
-    const auto& it = offsetTable.find(mq);
-    if (it != offsetTable.end()) {
-      std::string strMQ = RemotingSerializable::toJson(toJson(mq));
-      jOffsetTable[strMQ] = Json::Value((Json::Int64)it->second);
-    }
-  }
-  root["offsetTable"] = jOffsetTable;
-
-  std::lock_guard<std::mutex> lock2(m_fileMutex);
-  std::string storePathTmp = m_storePath + ".tmp";
-  std::ofstream ofstrm(storePathTmp, std::ios::binary | std::ios::out);
-  if (ofstrm.is_open()) {
-    try {
-      RemotingSerializable::toJson(root, ofstrm, true);
-    } catch (std::exception& e) {
-      THROW_MQEXCEPTION(MQClientException, "persistAll failed", -1);
-    }
-
-    if (!UtilAll::ReplaceFile(m_storePath, m_storePath + ".bak") || !UtilAll::ReplaceFile(storePathTmp, m_storePath)) {
-      LOG_ERROR("could not rename file: %s", strerror(errno));
-    }
-  }
-}
-
-void LocalFileOffsetStore::removeOffset(const MQMessageQueue& mq) {}
-
-std::map<MQMessageQueue, int64_t> LocalFileOffsetStore::readLocalOffset() {
-  std::lock_guard<std::mutex> lock(m_fileMutex);
-  std::ifstream ifstrm(m_storePath, std::ios::binary | std::ios::in);
-  if (ifstrm.is_open() && !ifstrm.eof()) {
-    try {
-      Json::Value root = RemotingSerializable::fromJson(ifstrm);
-      std::map<MQMessageQueue, int64_t> offsetTable;
-      auto& jOffsetTable = root["offsetTable"];
-      for (auto& strMQ : jOffsetTable.getMemberNames()) {
-        auto& offset = jOffsetTable[strMQ];
-        Json::Value jMQ = RemotingSerializable::fromJson(strMQ);
-        MQMessageQueue mq(jMQ["topic"].asString(), jMQ["brokerName"].asString(), jMQ["queueId"].asInt());
-        offsetTable.emplace(std::move(mq), offset.asInt64());
-      }
-      return offsetTable;
-    } catch (std::exception& e) {
-      // ...
-    }
-  }
-  return readLocalOffsetBak();
-}
-
-std::map<MQMessageQueue, int64_t> LocalFileOffsetStore::readLocalOffsetBak() {
-  std::map<MQMessageQueue, int64_t> offsetTable;
-  std::ifstream ifstrm(m_storePath + ".bak", std::ios::binary | std::ios::in);
-  if (ifstrm.is_open()) {
-    if (!ifstrm.eof()) {
-      try {
-        Json::Value root = RemotingSerializable::fromJson(ifstrm);
-        auto& jOffsetTable = root["offsetTable"];
-        for (auto& strMQ : jOffsetTable.getMemberNames()) {
-          auto& offset = jOffsetTable[strMQ];
-          Json::Value jMQ = RemotingSerializable::fromJson(strMQ);
-          MQMessageQueue mq(jMQ["topic"].asString(), jMQ["brokerName"].asString(), jMQ["queueId"].asInt());
-          offsetTable.emplace(std::move(mq), offset.asInt64());
-        }
-      } catch (const std::exception& e) {
-        LOG_WARN_NEW("readLocalOffset Exception {}", e.what());
-        THROW_MQEXCEPTION(MQClientException, "readLocalOffset Exception", -1);
-      }
-    }
-  }
-  return offsetTable;
-}
-
-//######################################
-// RemoteBrokerOffsetStore
-//######################################
-
-RemoteBrokerOffsetStore::RemoteBrokerOffsetStore(MQClientInstance* instance, const std::string& groupName)
-    : m_clientInstance(instance), m_groupName(groupName) {}
-
-RemoteBrokerOffsetStore::~RemoteBrokerOffsetStore() {
-  m_clientInstance = nullptr;
-  m_offsetTable.clear();
-}
-
-void RemoteBrokerOffsetStore::load() {}
-
-void RemoteBrokerOffsetStore::updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) {
-  std::lock_guard<std::mutex> lock(m_lock);
-  const auto& it = m_offsetTable.find(mq);
-  if (it == m_offsetTable.end() || !increaseOnly || offset > it->second) {
-    m_offsetTable[mq] = offset;
-  }
-}
-
-int64_t RemoteBrokerOffsetStore::readOffset(const MQMessageQueue& mq, ReadOffsetType type) {
-  switch (type) {
-    case MEMORY_FIRST_THEN_STORE:
-    case READ_FROM_MEMORY: {
-      std::lock_guard<std::mutex> lock(m_lock);
-
-      const auto& it = m_offsetTable.find(mq);
-      if (it != m_offsetTable.end()) {
-        return it->second;
-      } else if (READ_FROM_MEMORY == type) {
-        return -1;
-      }
-    }
-    case READ_FROM_STORE: {
-      try {
-        int64_t brokerOffset = fetchConsumeOffsetFromBroker(mq);
-        // update
-        updateOffset(mq, brokerOffset, false);
-        return brokerOffset;
-      } catch (MQBrokerException& e) {
-        LOG_ERROR(e.what());
-        return -1;
-      } catch (MQException& e) {
-        LOG_ERROR(e.what());
-        return -2;
-      }
-    }
-    default:
-      break;
-  }
-  return -1;
-}
-
-void RemoteBrokerOffsetStore::persist(const MQMessageQueue& mq) {
-  std::map<MQMessageQueue, int64_t> offsetTable;
-  {
-    std::lock_guard<std::mutex> lock(m_lock);
-    offsetTable = m_offsetTable;
-  }
-
-  const auto& it = offsetTable.find(mq);
-  if (it != offsetTable.end()) {
-    try {
-      updateConsumeOffsetToBroker(mq, it->second);
-    } catch (MQException& e) {
-      LOG_ERROR("updateConsumeOffsetToBroker error");
-    }
-  }
-}
-
-void RemoteBrokerOffsetStore::persistAll(const std::vector<MQMessageQueue>& mq) {}
-
-void RemoteBrokerOffsetStore::removeOffset(const MQMessageQueue& mq) {
-  std::lock_guard<std::mutex> lock(m_lock);
-  const auto& it = m_offsetTable.find(mq);
-  if (it != m_offsetTable.end()) {
-    m_offsetTable.erase(it);
-  }
-}
-
-void RemoteBrokerOffsetStore::updateConsumeOffsetToBroker(const MQMessageQueue& mq, int64_t offset) {
-  std::unique_ptr<FindBrokerResult> findBrokerResult(m_clientInstance->findBrokerAddressInAdmin(mq.getBrokerName()));
-
-  if (findBrokerResult == nullptr) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
-    findBrokerResult.reset(m_clientInstance->findBrokerAddressInAdmin(mq.getBrokerName()));
-  }
-
-  if (findBrokerResult != nullptr) {
-    UpdateConsumerOffsetRequestHeader* requestHeader = new UpdateConsumerOffsetRequestHeader();
-    requestHeader->topic = mq.getTopic();
-    requestHeader->consumerGroup = m_groupName;
-    requestHeader->queueId = mq.getQueueId();
-    requestHeader->commitOffset = offset;
-
-    try {
-      LOG_INFO("oneway updateConsumeOffsetToBroker of mq:%s, its offset is:%lld", mq.toString().c_str(), offset);
-      return m_clientInstance->getMQClientAPIImpl()->updateConsumerOffsetOneway(findBrokerResult->brokerAddr,
-                                                                                requestHeader, 1000 * 5);
-    } catch (MQException& e) {
-      LOG_ERROR(e.what());
-    }
-  }
-  LOG_WARN("The broker not exist");
-}
-
-int64_t RemoteBrokerOffsetStore::fetchConsumeOffsetFromBroker(const MQMessageQueue& mq) {
-  std::unique_ptr<FindBrokerResult> findBrokerResult(m_clientInstance->findBrokerAddressInAdmin(mq.getBrokerName()));
-
-  if (findBrokerResult == nullptr) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
-    findBrokerResult.reset(m_clientInstance->findBrokerAddressInAdmin(mq.getBrokerName()));
-  }
-
-  if (findBrokerResult != nullptr) {
-    QueryConsumerOffsetRequestHeader* requestHeader = new QueryConsumerOffsetRequestHeader();
-    requestHeader->topic = mq.getTopic();
-    requestHeader->consumerGroup = m_groupName;
-    requestHeader->queueId = mq.getQueueId();
-
-    return m_clientInstance->getMQClientAPIImpl()->queryConsumerOffset(findBrokerResult->brokerAddr, requestHeader,
-                                                                       1000 * 5);
-  } else {
-    LOG_ERROR("The broker not exist when fetchConsumeOffsetFromBroker");
-    THROW_MQEXCEPTION(MQClientException, "The broker not exist", -1);
-  }
-}
-
-}  // namespace rocketmq
diff --git a/src/consumer/OffsetStore.h b/src/consumer/OffsetStore.h
deleted file mode 100644
index bbabfff..0000000
--- a/src/consumer/OffsetStore.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __OFFSET_STORE_H__
-#define __OFFSET_STORE_H__
-
-#include <map>
-#include <mutex>
-#include <vector>
-
-#include "MQClientInstance.h"
-#include "MQMessageQueue.h"
-
-namespace rocketmq {
-
-enum ReadOffsetType {
-  // read offset from memory
-  READ_FROM_MEMORY,
-  // read offset from remoting
-  READ_FROM_STORE,
-  // read offset from memory firstly, then from remoting
-  MEMORY_FIRST_THEN_STORE,
-};
-
-class OffsetStore {
- public:
-  virtual ~OffsetStore() = default;
-
-  virtual void load() = 0;
-  virtual void updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) = 0;
-  virtual int64_t readOffset(const MQMessageQueue& mq, ReadOffsetType type) = 0;
-  virtual void persist(const MQMessageQueue& mq) = 0;
-  virtual void persistAll(const std::vector<MQMessageQueue>& mq) = 0;
-  virtual void removeOffset(const MQMessageQueue& mq) = 0;
-};
-
-class LocalFileOffsetStore : public OffsetStore {
- public:
-  LocalFileOffsetStore(MQClientInstance* instance, const std::string& groupName);
-  virtual ~LocalFileOffsetStore();
-
-  void load() override;
-  void updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) override;
-  int64_t readOffset(const MQMessageQueue& mq, ReadOffsetType type) override;
-  void persist(const MQMessageQueue& mq) override;
-  void persistAll(const std::vector<MQMessageQueue>& mq) override;
-  void removeOffset(const MQMessageQueue& mq) override;
-
- private:
-  std::map<MQMessageQueue, int64_t> readLocalOffset();
-  std::map<MQMessageQueue, int64_t> readLocalOffsetBak();
-
- private:
-  MQClientInstance* m_clientInstance;
-  std::string m_groupName;
-
-  std::map<MQMessageQueue, int64_t> m_offsetTable;
-  std::mutex m_lock;
-
-  std::string m_storePath;
-  std::mutex m_fileMutex;
-};
-
-class RemoteBrokerOffsetStore : public OffsetStore {
- public:
-  RemoteBrokerOffsetStore(MQClientInstance* instance, const std::string& groupName);
-  virtual ~RemoteBrokerOffsetStore();
-
-  void load() override;
-  void updateOffset(const MQMessageQueue& mq, int64_t offset, bool increaseOnly) override;
-  int64_t readOffset(const MQMessageQueue& mq, ReadOffsetType type) override;
-  void persist(const MQMessageQueue& mq) override;
-  void persistAll(const std::vector<MQMessageQueue>& mq) override;
-  void removeOffset(const MQMessageQueue& mq) override;
-
- private:
-  void updateConsumeOffsetToBroker(const MQMessageQueue& mq, int64_t offset);
-  int64_t fetchConsumeOffsetFromBroker(const MQMessageQueue& mq);
-
- private:
-  MQClientInstance* m_clientInstance;
-  std::string m_groupName;
-
-  std::map<MQMessageQueue, int64_t> m_offsetTable;
-  std::mutex m_lock;
-};
-
-}  // namespace rocketmq
-
-#endif  // __OFFSET_STORE_H__
diff --git a/src/consumer/ProcessQueue.cpp b/src/consumer/ProcessQueue.cpp
index 285caed..dee12f3 100644
--- a/src/consumer/ProcessQueue.cpp
+++ b/src/consumer/ProcessQueue.cpp
@@ -20,65 +20,66 @@
 #include "ProcessQueueInfo.h"
 #include "UtilAll.h"
 
+static const uint64_t PULL_MAX_IDLE_TIME = 120000;  // ms
+
 namespace rocketmq {
 
-const uint64_t ProcessQueue::RebalanceLockMaxLiveTime = 30000;
-const uint64_t ProcessQueue::RebalanceLockInterval = 20000;
-const uint64_t ProcessQueue::PullMaxIdleTime = 120000;
+const uint64_t ProcessQueue::REBALANCE_LOCK_MAX_LIVE_TIME = 30000;
+const uint64_t ProcessQueue::REBALANCE_LOCK_INTERVAL = 20000;
 
 ProcessQueue::ProcessQueue()
-    : m_queueOffsetMax(0),
-      m_dropped(false),
-      m_lastPullTimestamp(UtilAll::currentTimeMillis()),
-      m_lastConsumeTimestamp(UtilAll::currentTimeMillis()),
-      m_locked(false),
-      m_lastLockTimestamp(UtilAll::currentTimeMillis()) {}
+    : queue_offset_max_(0),
+      dropped_(false),
+      last_pull_timestamp_(UtilAll::currentTimeMillis()),
+      last_consume_timestamp_(UtilAll::currentTimeMillis()),
+      locked_(false),
+      last_lock_timestamp_(UtilAll::currentTimeMillis()) {}
 
 ProcessQueue::~ProcessQueue() {
-  m_msgTreeMap.clear();
-  m_consumingMsgOrderlyTreeMap.clear();
+  msg_tree_map_.clear();
+  consuming_msg_orderly_tree_map_.clear();
 }
 
 bool ProcessQueue::isLockExpired() const {
-  return (UtilAll::currentTimeMillis() - m_lastLockTimestamp) > RebalanceLockMaxLiveTime;
+  return (UtilAll::currentTimeMillis() - last_lock_timestamp_) > REBALANCE_LOCK_MAX_LIVE_TIME;
 }
 
 bool ProcessQueue::isPullExpired() const {
-  return (UtilAll::currentTimeMillis() - m_lastPullTimestamp) > PullMaxIdleTime;
+  return (UtilAll::currentTimeMillis() - last_pull_timestamp_) > PULL_MAX_IDLE_TIME;
 }
 
 void ProcessQueue::putMessage(const std::vector<MessageExtPtr>& msgs) {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
 
   for (const auto& msg : msgs) {
     int64_t offset = msg->getQueueOffset();
-    m_msgTreeMap[offset] = msg;
-    if (offset > m_queueOffsetMax) {
-      m_queueOffsetMax = offset;
+    msg_tree_map_[offset] = msg;
+    if (offset > queue_offset_max_) {
+      queue_offset_max_ = offset;
     }
   }
 
-  LOG_DEBUG_NEW("ProcessQueue: putMessage m_queueOffsetMax:{}", m_queueOffsetMax);
+  LOG_DEBUG_NEW("ProcessQueue: putMessage queue_offset_max:{}", queue_offset_max_);
 }
 
 int64_t ProcessQueue::removeMessage(const std::vector<MessageExtPtr>& msgs) {
   int64_t result = -1;
   const auto now = UtilAll::currentTimeMillis();
 
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
-  m_lastConsumeTimestamp = now;
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
+  last_consume_timestamp_ = now;
 
-  if (!m_msgTreeMap.empty()) {
-    result = m_queueOffsetMax + 1;
-    LOG_DEBUG_NEW("offset result is:{}, m_queueOffsetMax is:{}, msgs size:{}", result, m_queueOffsetMax, msgs.size());
+  if (!msg_tree_map_.empty()) {
+    result = queue_offset_max_ + 1;
+    LOG_DEBUG_NEW("offset result is:{}, queue_offset_max is:{}, msgs size:{}", result, queue_offset_max_, msgs.size());
 
     for (auto& msg : msgs) {
-      LOG_DEBUG_NEW("remove these msg from m_msgTreeMap, its offset:{}", msg->getQueueOffset());
-      m_msgTreeMap.erase(msg->getQueueOffset());
+      LOG_DEBUG_NEW("remove these msg from msg_tree_map, its offset:{}", msg->getQueueOffset());
+      msg_tree_map_.erase(msg->getQueueOffset());
     }
 
-    if (!m_msgTreeMap.empty()) {
-      auto it = m_msgTreeMap.begin();
+    if (!msg_tree_map_.empty()) {
+      auto it = msg_tree_map_.begin();
       result = it->first;
     }
   }
@@ -87,44 +88,30 @@ int64_t ProcessQueue::removeMessage(const std::vector<MessageExtPtr>& msgs) {
 }
 
 int ProcessQueue::getCacheMsgCount() {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
-  return static_cast<int>(m_msgTreeMap.size());
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
+  return static_cast<int>(msg_tree_map_.size() + consuming_msg_orderly_tree_map_.size());
 }
 
 int64_t ProcessQueue::getCacheMinOffset() {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
-  if (m_msgTreeMap.empty()) {
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
+  if (msg_tree_map_.empty() && consuming_msg_orderly_tree_map_.empty()) {
     return 0;
+  } else if (!consuming_msg_orderly_tree_map_.empty()) {
+    return consuming_msg_orderly_tree_map_.begin()->first;
   } else {
-    return m_msgTreeMap.begin()->first;
+    return msg_tree_map_.begin()->first;
   }
 }
 
 int64_t ProcessQueue::getCacheMaxOffset() {
-  return m_queueOffsetMax;
-}
-
-bool ProcessQueue::isDropped() const {
-  return m_dropped.load();
-}
-
-void ProcessQueue::setDropped(bool dropped) {
-  m_dropped.store(dropped);
-}
-
-bool ProcessQueue::isLocked() const {
-  return m_locked.load();
-}
-
-void ProcessQueue::setLocked(bool locked) {
-  m_locked.store(locked);
+  return queue_offset_max_;
 }
 
 int64_t ProcessQueue::commit() {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
-  if (!m_consumingMsgOrderlyTreeMap.empty()) {
-    int64_t offset = (--m_consumingMsgOrderlyTreeMap.end())->first;
-    m_consumingMsgOrderlyTreeMap.clear();
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
+  if (!consuming_msg_orderly_tree_map_.empty()) {
+    int64_t offset = (--consuming_msg_orderly_tree_map_.end())->first;
+    consuming_msg_orderly_tree_map_.clear();
     return offset + 1;
   } else {
     return -1;
@@ -132,94 +119,55 @@ int64_t ProcessQueue::commit() {
 }
 
 void ProcessQueue::makeMessageToCosumeAgain(std::vector<MessageExtPtr>& msgs) {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
   for (const auto& msg : msgs) {
-    m_msgTreeMap[msg->getQueueOffset()] = msg;
-    m_consumingMsgOrderlyTreeMap.erase(msg->getQueueOffset());
+    msg_tree_map_[msg->getQueueOffset()] = msg;
+    consuming_msg_orderly_tree_map_.erase(msg->getQueueOffset());
   }
 }
 
 void ProcessQueue::takeMessages(std::vector<MessageExtPtr>& out_msgs, int batchSize) {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
-  for (int i = 0; i != batchSize; i++) {
-    const auto& it = m_msgTreeMap.begin();
-    if (it != m_msgTreeMap.end()) {
-      out_msgs.push_back(it->second);
-      m_consumingMsgOrderlyTreeMap[it->first] = it->second;
-      m_msgTreeMap.erase(it);
-    }
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
+  for (auto it = msg_tree_map_.begin(); it != msg_tree_map_.end() && batchSize--;) {
+    out_msgs.push_back(it->second);
+    consuming_msg_orderly_tree_map_[it->first] = it->second;
+    it = msg_tree_map_.erase(it);
   }
 }
 
 void ProcessQueue::clearAllMsgs() {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
 
-  if (isDropped()) {
-    LOG_DEBUG_NEW("clear m_msgTreeMap as PullRequest had been dropped.");
-    m_msgTreeMap.clear();
-    m_consumingMsgOrderlyTreeMap.clear();
-    m_queueOffsetMax = 0;
+  if (dropped()) {
+    LOG_DEBUG_NEW("clear msg_tree_map as PullRequest had been dropped.");
+    msg_tree_map_.clear();
+    consuming_msg_orderly_tree_map_.clear();
+    queue_offset_max_ = 0;
   }
 }
 
-uint64_t ProcessQueue::getLastLockTimestamp() const {
-  return m_lastLockTimestamp;
-}
-
-void ProcessQueue::setLastLockTimestamp(int64_t lastLockTimestamp) {
-  m_lastLockTimestamp = lastLockTimestamp;
-}
-
-std::timed_mutex& ProcessQueue::getLockConsume() {
-  return m_lockConsume;
-}
-
-uint64_t ProcessQueue::getLastPullTimestamp() const {
-  return m_lastPullTimestamp;
-}
-
-void ProcessQueue::setLastPullTimestamp(uint64_t lastPullTimestamp) {
-  m_lastPullTimestamp = lastPullTimestamp;
-}
-
-long ProcessQueue::getTryUnlockTimes() {
-  return m_tryUnlockTimes.load();
-}
-
-void ProcessQueue::incTryUnlockTimes() {
-  m_tryUnlockTimes.fetch_add(1);
-}
-
-uint64_t ProcessQueue::getLastConsumeTimestamp() {
-  return m_lastConsumeTimestamp;
-}
-
-void ProcessQueue::setLastConsumeTimestamp(uint64_t lastConsumeTimestamp) {
-  m_lastConsumeTimestamp = lastConsumeTimestamp;
-}
-
 void ProcessQueue::fillProcessQueueInfo(ProcessQueueInfo& info) {
-  std::lock_guard<std::mutex> lock(m_lockTreeMap);
+  std::lock_guard<std::mutex> lock(lock_tree_map_);
 
-  if (!m_msgTreeMap.empty()) {
-    info.cachedMsgMinOffset = m_msgTreeMap.begin()->first;
-    info.cachedMsgMaxOffset = m_queueOffsetMax;
-    info.cachedMsgCount = m_msgTreeMap.size();
+  if (!msg_tree_map_.empty()) {
+    info.cachedMsgMinOffset = msg_tree_map_.begin()->first;
+    info.cachedMsgMaxOffset = queue_offset_max_;
+    info.cachedMsgCount = msg_tree_map_.size();
   }
 
-  if (!m_consumingMsgOrderlyTreeMap.empty()) {
-    info.transactionMsgMinOffset = m_consumingMsgOrderlyTreeMap.begin()->first;
-    info.transactionMsgMaxOffset = (--m_consumingMsgOrderlyTreeMap.end())->first;
-    info.transactionMsgCount = m_consumingMsgOrderlyTreeMap.size();
+  if (!consuming_msg_orderly_tree_map_.empty()) {
+    info.transactionMsgMinOffset = consuming_msg_orderly_tree_map_.begin()->first;
+    info.transactionMsgMaxOffset = (--consuming_msg_orderly_tree_map_.end())->first;
+    info.transactionMsgCount = consuming_msg_orderly_tree_map_.size();
   }
 
-  info.setLocked(m_locked);
-  info.tryUnlockTimes = m_tryUnlockTimes.load();
-  info.lastLockTimestamp = m_lastLockTimestamp;
+  info.setLocked(locked_);
+  info.tryUnlockTimes = try_unlock_times_.load();
+  info.lastLockTimestamp = last_lock_timestamp_;
 
-  info.setDroped(m_dropped);
-  info.lastPullTimestamp = m_lastPullTimestamp;
-  info.lastConsumeTimestamp = m_lastConsumeTimestamp;
+  info.setDroped(dropped_);
+  info.lastPullTimestamp = last_pull_timestamp_;
+  info.lastConsumeTimestamp = last_consume_timestamp_;
 }
 
 }  // namespace rocketmq
diff --git a/src/consumer/ProcessQueue.h b/src/consumer/ProcessQueue.h
index e2780ed..37ce7ed 100644
--- a/src/consumer/ProcessQueue.h
+++ b/src/consumer/ProcessQueue.h
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PROCESS_QUEUE_H__
-#define __PROCESS_QUEUE_H__
+#ifndef ROCKETMQ_CONSUMER_PROCESSQUEUE_H_
+#define ROCKETMQ_CONSUMER_PROCESSQUEUE_H_
 
-#include <atomic>
-#include <map>
-#include <memory>
-#include <mutex>
-#include <vector>
+#include <atomic>  // std::atomic
+#include <map>     // std::map
+#include <memory>  // std::shared_ptr
+#include <mutex>   // std::mutex
+#include <vector>  // std::vector
 
 #include "MessageExt.h"
 
@@ -34,8 +34,8 @@ typedef std::shared_ptr<ProcessQueue> ProcessQueuePtr;
 
 class ROCKETMQCLIENT_API ProcessQueue {
  public:
-  static const uint64_t RebalanceLockMaxLiveTime;  // ms
-  static const uint64_t RebalanceLockInterval;     // ms
+  static const uint64_t REBALANCE_LOCK_MAX_LIVE_TIME;  // ms
+  static const uint64_t REBALANCE_LOCK_INTERVAL;       // ms
 
  public:
   ProcessQueue();
@@ -51,51 +51,51 @@ class ROCKETMQCLIENT_API ProcessQueue {
   int64_t getCacheMinOffset();
   int64_t getCacheMaxOffset();
 
-  bool isDropped() const;
-  void setDropped(bool dropped);
-
-  bool isLocked() const;
-  void setLocked(bool locked);
-
   int64_t commit();
   void makeMessageToCosumeAgain(std::vector<MessageExtPtr>& msgs);
   void takeMessages(std::vector<MessageExtPtr>& out_msgs, int batchSize);
 
   void clearAllMsgs();
 
-  uint64_t getLastLockTimestamp() const;
-  void setLastLockTimestamp(int64_t lastLockTimestamp);
+  void fillProcessQueueInfo(ProcessQueueInfo& info);
 
-  std::timed_mutex& getLockConsume();
+ public:
+  inline std::timed_mutex& lock_consume() { return lock_consume_; }
 
-  uint64_t getLastPullTimestamp() const;
-  void setLastPullTimestamp(uint64_t lastPullTimestamp);
+  inline long try_unlock_times() const { return try_unlock_times_.load(); }
+  inline void inc_try_unlock_times() { try_unlock_times_.fetch_add(1); }
 
-  long getTryUnlockTimes();
-  void incTryUnlockTimes();
+  inline bool dropped() const { return dropped_.load(); }
+  inline void set_dropped(bool dropped) { dropped_.store(dropped); }
 
-  uint64_t getLastConsumeTimestamp();
-  void setLastConsumeTimestamp(uint64_t lastConsumeTimestamp);
+  inline uint64_t last_pull_timestamp() const { return last_pull_timestamp_; }
+  inline void set_last_pull_timestamp(uint64_t lastPullTimestamp) { last_pull_timestamp_ = lastPullTimestamp; }
 
-  void fillProcessQueueInfo(ProcessQueueInfo& info);
+  inline uint64_t last_consume_timestamp() const { return last_consume_timestamp_; }
+  inline void set_last_consume_timestamp(uint64_t lastConsumeTimestamp) {
+    last_consume_timestamp_ = lastConsumeTimestamp;
+  }
 
- private:
-  static const uint64_t PullMaxIdleTime;
+  inline bool locked() const { return locked_.load(); }
+  inline void set_locked(bool locked) { locked_.store(locked); }
+
+  inline uint64_t last_lock_timestamp() const { return last_lock_timestamp_; }
+  inline void set_last_lock_timestamp(int64_t lastLockTimestamp) { last_lock_timestamp_ = lastLockTimestamp; }
 
  private:
-  std::mutex m_lockTreeMap;
-  std::map<int64_t, MessageExtPtr> m_msgTreeMap;
-  std::timed_mutex m_lockConsume;
-  std::map<int64_t, MessageExtPtr> m_consumingMsgOrderlyTreeMap;
-  std::atomic<long> m_tryUnlockTimes;
-  volatile int64_t m_queueOffsetMax;
-  std::atomic<bool> m_dropped;
-  volatile uint64_t m_lastPullTimestamp;
-  volatile uint64_t m_lastConsumeTimestamp;
-  std::atomic<bool> m_locked;
-  volatile uint64_t m_lastLockTimestamp;  // ms
+  std::mutex lock_tree_map_;
+  std::map<int64_t, MessageExtPtr> msg_tree_map_;
+  std::timed_mutex lock_consume_;
+  std::map<int64_t, MessageExtPtr> consuming_msg_orderly_tree_map_;
+  std::atomic<long> try_unlock_times_;
+  volatile int64_t queue_offset_max_;
+  std::atomic<bool> dropped_;
+  volatile uint64_t last_pull_timestamp_;
+  volatile uint64_t last_consume_timestamp_;
+  std::atomic<bool> locked_;
+  volatile uint64_t last_lock_timestamp_;  // ms
 };
 
 }  // namespace rocketmq
 
-#endif  // __PROCESS_QUEUE_H__
+#endif  // ROCKETMQ_CONSUMER_PROCESSQUEUE_H_
diff --git a/src/consumer/PullAPIWrapper.cpp b/src/consumer/PullAPIWrapper.cpp
index 221f285..96a9a8f 100644
--- a/src/consumer/PullAPIWrapper.cpp
+++ b/src/consumer/PullAPIWrapper.cpp
@@ -20,31 +20,31 @@
 #include "MQClientAPIImpl.h"
 #include "MQClientInstance.h"
 #include "MessageDecoder.h"
-#include "MessageAccessor.h"
-#include "PullResultExt.h"
+#include "MessageAccessor.hpp"
+#include "PullResultExt.hpp"
 #include "PullSysFlag.h"
 
 namespace rocketmq {
 
 PullAPIWrapper::PullAPIWrapper(MQClientInstance* instance, const std::string& consumerGroup) {
-  m_clientInstance = instance;
-  m_consumerGroup = consumerGroup;
+  client_instance_ = instance;
+  consumer_group_ = consumerGroup;
 }
 
 PullAPIWrapper::~PullAPIWrapper() {
-  m_clientInstance = nullptr;
-  m_pullFromWhichNodeTable.clear();
+  client_instance_ = nullptr;
+  pull_from_which_node_table_.clear();
 }
 
 void PullAPIWrapper::updatePullFromWhichNode(const MQMessageQueue& mq, int brokerId) {
-  std::lock_guard<std::mutex> lock(m_lock);
-  m_pullFromWhichNodeTable[mq] = brokerId;
+  std::lock_guard<std::mutex> lock(lock_);
+  pull_from_which_node_table_[mq] = brokerId;
 }
 
 int PullAPIWrapper::recalculatePullFromWhichNode(const MQMessageQueue& mq) {
-  std::lock_guard<std::mutex> lock(m_lock);
-  const auto& it = m_pullFromWhichNodeTable.find(mq);
-  if (it != m_pullFromWhichNodeTable.end()) {
+  std::lock_guard<std::mutex> lock(lock_);
+  const auto& it = pull_from_which_node_table_.find(mq);
+  if (it != pull_from_which_node_table_.end()) {
     return it->second;
   }
   return MASTER_ID;
@@ -52,7 +52,7 @@ int PullAPIWrapper::recalculatePullFromWhichNode(const MQMessageQueue& mq) {
 
 PullResult PullAPIWrapper::processPullResult(const MQMessageQueue& mq,
                                              PullResult& pullResult,
-                                             SubscriptionDataPtr subscriptionData) {
+                                             SubscriptionData* subscriptionData) {
   assert(std::type_index(typeid(pullResult)) == std::type_index(typeid(PullResultExt)));
   auto& pullResultExt = dynamic_cast<PullResultExt&>(pullResult);
 
@@ -66,11 +66,11 @@ PullResult PullAPIWrapper::processPullResult(const MQMessageQueue& mq,
     auto msgList = MessageDecoder::decodes(*byteBuffer);
 
     // filter msg list again
-    if (subscriptionData != nullptr && !subscriptionData->getTagsSet().empty()) {
+    if (subscriptionData != nullptr && !subscriptionData->tags_set().empty()) {
       msgListFilterAgain.reserve(msgList.size());
       for (const auto& msg : msgList) {
         const auto& msgTag = msg->getTags();
-        if (subscriptionData->containTag(msgTag)) {
+        if (subscriptionData->contain_tag(msgTag)) {
           msgListFilterAgain.push_back(msg);
         }
       }
@@ -106,24 +106,24 @@ PullResult* PullAPIWrapper::pullKernelImpl(const MQMessageQueue& mq,
                                            CommunicationMode communicationMode,  // 10
                                            PullCallback* pullCallback) {
   std::unique_ptr<FindBrokerResult> findBrokerResult(
-      m_clientInstance->findBrokerAddressInSubscribe(mq.getBrokerName(), recalculatePullFromWhichNode(mq), false));
+      client_instance_->findBrokerAddressInSubscribe(mq.broker_name(), recalculatePullFromWhichNode(mq), false));
   if (findBrokerResult == nullptr) {
-    m_clientInstance->updateTopicRouteInfoFromNameServer(mq.getTopic());
+    client_instance_->updateTopicRouteInfoFromNameServer(mq.topic());
     findBrokerResult.reset(
-        m_clientInstance->findBrokerAddressInSubscribe(mq.getBrokerName(), recalculatePullFromWhichNode(mq), false));
+        client_instance_->findBrokerAddressInSubscribe(mq.broker_name(), recalculatePullFromWhichNode(mq), false));
   }
 
   if (findBrokerResult != nullptr) {
     int sysFlagInner = sysFlag;
 
-    if (findBrokerResult->slave) {
+    if (findBrokerResult->slave()) {
       sysFlagInner = PullSysFlag::clearCommitOffsetFlag(sysFlagInner);
     }
 
     PullMessageRequestHeader* pRequestHeader = new PullMessageRequestHeader();
-    pRequestHeader->consumerGroup = m_consumerGroup;
-    pRequestHeader->topic = mq.getTopic();
-    pRequestHeader->queueId = mq.getQueueId();
+    pRequestHeader->consumerGroup = consumer_group_;
+    pRequestHeader->topic = mq.topic();
+    pRequestHeader->queueId = mq.queue_id();
     pRequestHeader->queueOffset = offset;
     pRequestHeader->maxMsgNums = maxNums;
     pRequestHeader->sysFlag = sysFlagInner;
@@ -132,11 +132,11 @@ PullResult* PullAPIWrapper::pullKernelImpl(const MQMessageQueue& mq,
     pRequestHeader->subscription = subExpression;
     pRequestHeader->subVersion = subVersion;
 
-    return m_clientInstance->getMQClientAPIImpl()->pullMessage(findBrokerResult->brokerAddr, pRequestHeader,
+    return client_instance_->getMQClientAPIImpl()->pullMessage(findBrokerResult->broker_addr(), pRequestHeader,
                                                                timeoutMillis, communicationMode, pullCallback);
   }
 
-  THROW_MQEXCEPTION(MQClientException, "The broker [" + mq.getBrokerName() + "] not exist", -1);
+  THROW_MQEXCEPTION(MQClientException, "The broker [" + mq.broker_name() + "] not exist", -1);
 }
 
 }  // namespace rocketmq
diff --git a/src/consumer/PullAPIWrapper.h b/src/consumer/PullAPIWrapper.h
index ce8f5c0..02055d0 100644
--- a/src/consumer/PullAPIWrapper.h
+++ b/src/consumer/PullAPIWrapper.h
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PULL_API_WRAPPER_H__
-#define __PULL_API_WRAPPER_H__
+#ifndef ROCKETMQ_CONSUMER_PULLAPIWRAPPER_H_
+#define ROCKETMQ_CONSUMER_PULLAPIWRAPPER_H_
 
-#include <mutex>
+#include <mutex>  // std::mutex
 
 #include "CommunicationMode.h"
 #include "MQClientInstance.h"
@@ -32,7 +32,7 @@ class PullAPIWrapper {
   PullAPIWrapper(MQClientInstance* instance, const std::string& consumerGroup);
   ~PullAPIWrapper();
 
-  PullResult processPullResult(const MQMessageQueue& mq, PullResult& pullResult, SubscriptionDataPtr subscriptionData);
+  PullResult processPullResult(const MQMessageQueue& mq, PullResult& pullResult, SubscriptionData* subscriptionData);
 
   PullResult* pullKernelImpl(const MQMessageQueue& mq,             // 1
                              const std::string& subExpression,     // 2
@@ -52,12 +52,12 @@ class PullAPIWrapper {
   int recalculatePullFromWhichNode(const MQMessageQueue& mq);
 
  private:
-  MQClientInstance* m_clientInstance;
-  std::string m_consumerGroup;
-  std::mutex m_lock;
-  std::map<MQMessageQueue, int /* brokerId */> m_pullFromWhichNodeTable;
+  MQClientInstance* client_instance_;
+  std::string consumer_group_;
+  std::mutex lock_;
+  std::map<MQMessageQueue, int /* brokerId */> pull_from_which_node_table_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __PULL_API_WRAPPER_H__
+#endif  // ROCKETMQ_CONSUMER_PULLAPIWRAPPER_H_
diff --git a/src/consumer/PullMessageService.hpp b/src/consumer/PullMessageService.hpp
index 8f6a6d5..7b22e8b 100644
--- a/src/consumer/PullMessageService.hpp
+++ b/src/consumer/PullMessageService.hpp
@@ -14,29 +14,29 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PULL_MESSAGE_SERVICE_HPP__
-#define __PULL_MESSAGE_SERVICE_HPP__
+#ifndef ROCKETMQ_CONSUMER_PULLMESSAGESERVICE_HPP_
+#define ROCKETMQ_CONSUMER_PULLMESSAGESERVICE_HPP_
 
+#include "concurrent/executor.hpp"
 #include "DefaultMQPushConsumerImpl.h"
 #include "Logging.h"
 #include "MQClientInstance.h"
 #include "PullRequest.h"
-#include "concurrent/executor.hpp"
 
 namespace rocketmq {
 
 class PullMessageService {
  public:
   PullMessageService(MQClientInstance* instance)
-      : m_clientInstance(instance), m_scheduledExecutorService(getServiceName(), 1, false) {}
+      : client_instance_(instance), scheduled_executor_service_(getServiceName(), 1, false) {}
 
-  void start() { m_scheduledExecutorService.startup(); }
+  void start() { scheduled_executor_service_.startup(); }
 
-  void shutdown() { m_scheduledExecutorService.shutdown(); }
+  void shutdown() { scheduled_executor_service_.shutdown(); }
 
   void executePullRequestLater(PullRequestPtr pullRequest, long timeDelay) {
-    if (m_clientInstance->isRunning()) {
-      m_scheduledExecutorService.schedule(
+    if (client_instance_->isRunning()) {
+      scheduled_executor_service_.schedule(
           std::bind(&PullMessageService::executePullRequestImmediately, this, pullRequest), timeDelay,
           time_unit::milliseconds);
     } else {
@@ -45,18 +45,18 @@ class PullMessageService {
   }
 
   void executePullRequestImmediately(PullRequestPtr pullRequest) {
-    m_scheduledExecutorService.submit(std::bind(&PullMessageService::pullMessage, this, pullRequest));
+    scheduled_executor_service_.submit(std::bind(&PullMessageService::pullMessage, this, pullRequest));
   }
 
   void executeTaskLater(const handler_type& task, long timeDelay) {
-    m_scheduledExecutorService.schedule(task, timeDelay, time_unit::milliseconds);
+    scheduled_executor_service_.schedule(task, timeDelay, time_unit::milliseconds);
   }
 
   std::string getServiceName() { return "PullMessageService"; }
 
  private:
   void pullMessage(PullRequestPtr pullRequest) {
-    MQConsumerInner* consumer = m_clientInstance->selectConsumer(pullRequest->getConsumerGroup());
+    MQConsumerInner* consumer = client_instance_->selectConsumer(pullRequest->consumer_group());
     if (consumer != nullptr &&
         std::type_index(typeid(*consumer)) == std::type_index(typeid(DefaultMQPushConsumerImpl))) {
       auto* impl = static_cast<DefaultMQPushConsumerImpl*>(consumer);
@@ -67,10 +67,10 @@ class PullMessageService {
   }
 
  private:
-  MQClientInstance* m_clientInstance;
-  scheduled_thread_pool_executor m_scheduledExecutorService;
+  MQClientInstance* client_instance_;
+  scheduled_thread_pool_executor scheduled_executor_service_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __PULL_MESSAGE_SERVICE_HPP__
+#endif  // ROCKETMQ_CONSUMER_PULLMESSAGESERVICE_HPP_
diff --git a/src/consumer/PullRequest.cpp b/src/consumer/PullRequest.cpp
index 2ff69d0..e764195 100644
--- a/src/consumer/PullRequest.cpp
+++ b/src/consumer/PullRequest.cpp
@@ -16,60 +16,12 @@
  */
 #include "PullRequest.h"
 
-#include <sstream>  // std::stringstream
-
-#include "Logging.h"
-
 namespace rocketmq {
 
-PullRequest::PullRequest() : m_nextOffset(0), m_lockedFirst(false) {}
-
-PullRequest::~PullRequest() {}
-
-bool PullRequest::isLockedFirst() const {
-  return m_lockedFirst;
-}
-
-void PullRequest::setLockedFirst(bool lockedFirst) {
-  m_lockedFirst = lockedFirst;
-}
-
-const std::string& PullRequest::getConsumerGroup() const {
-  return m_consumerGroup;
-}
-
-void PullRequest::setConsumerGroup(const std::string& consumerGroup) {
-  m_consumerGroup = consumerGroup;
-}
-
-const MQMessageQueue& PullRequest::getMessageQueue() {
-  return m_messageQueue;
-}
-
-void PullRequest::setMessageQueue(const MQMessageQueue& messageQueue) {
-  m_messageQueue = messageQueue;
-}
-
-int64_t PullRequest::getNextOffset() {
-  return m_nextOffset;
-}
-
-void PullRequest::setNextOffset(int64_t nextOffset) {
-  m_nextOffset = nextOffset;
-}
-
-ProcessQueuePtr PullRequest::getProcessQueue() {
-  return m_processQueue;
-}
-
-void PullRequest::setProcessQueue(ProcessQueuePtr processQueue) {
-  m_processQueue = processQueue;
-}
-
 std::string PullRequest::toString() const {
   std::stringstream ss;
-  ss << "PullRequest [consumerGroup=" << m_consumerGroup << ", messageQueue=" << m_messageQueue.toString()
-     << ", nextOffset=" << m_nextOffset << "]";
+  ss << "PullRequest [consumerGroup=" << consumer_group_ << ", messageQueue=" << message_queue_.toString()
+     << ", nextOffset=" << next_offset_ << "]";
   return ss.str();
 }
 
diff --git a/src/consumer/PullRequest.h b/src/consumer/PullRequest.h
index e86c07d..f9a0975 100644
--- a/src/consumer/PullRequest.h
+++ b/src/consumer/PullRequest.h
@@ -14,12 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __PULL_REQUEST_H__
-#define __PULL_REQUEST_H__
+#ifndef ROCKETMQ_CONSUMER_PULLREQUEST_H_
+#define ROCKETMQ_CONSUMER_PULLREQUEST_H_
 
-#include <atomic>
-#include <memory>
-#include <mutex>
+#include <sstream>  // std::stringstream
 
 #include "MQMessageQueue.h"
 #include "ProcessQueue.h"
@@ -31,34 +29,34 @@ typedef std::shared_ptr<PullRequest> PullRequestPtr;
 
 class ROCKETMQCLIENT_API PullRequest {
  public:
-  PullRequest();
-  virtual ~PullRequest();
+  PullRequest() : next_offset_(0), locked_first_(false) {}
+  virtual ~PullRequest() = default;
 
-  bool isLockedFirst() const;
-  void setLockedFirst(bool lockedFirst);
+  inline bool locked_first() const { return locked_first_; }
+  inline void set_locked_first(bool lockedFirst) { locked_first_ = lockedFirst; }
 
-  const std::string& getConsumerGroup() const;
-  void setConsumerGroup(const std::string& consumerGroup);
+  inline const std::string& consumer_group() const { return consumer_group_; }
+  inline void set_consumer_group(const std::string& consumerGroup) { consumer_group_ = consumerGroup; }
 
-  const MQMessageQueue& getMessageQueue();
-  void setMessageQueue(const MQMessageQueue& messageQueue);
+  inline const MQMessageQueue& message_queue() { return message_queue_; }
+  inline void set_message_queue(const MQMessageQueue& messageQueue) { message_queue_ = messageQueue; }
 
-  int64_t getNextOffset();
-  void setNextOffset(int64_t nextOffset);
+  inline int64_t next_offset() { return next_offset_; }
+  inline void set_next_offset(int64_t nextOffset) { next_offset_ = nextOffset; }
 
-  ProcessQueuePtr getProcessQueue();
-  void setProcessQueue(ProcessQueuePtr processQueue);
+  inline ProcessQueuePtr process_queue() { return process_queue_; }
+  inline void set_process_queue(ProcessQueuePtr processQueue) { process_queue_ = processQueue; }
 
   std::string toString() const;
 
  private:
-  std::string m_consumerGroup;
-  MQMessageQueue m_messageQueue;
-  ProcessQueuePtr m_processQueue;
-  int64_t m_nextOffset;
-  bool m_lockedFirst;
+  std::string consumer_group_;
+  MQMessageQueue message_queue_;
+  ProcessQueuePtr process_queue_;
+  int64_t next_offset_;
+  bool locked_first_;
 };
 
 }  // namespace rocketmq
 
-#endif  // __PULL_REQUEST_H__
+#endif  // ROCKETMQ_CONSUMER_PULLREQUEST_H_
diff --git a/src/consumer/PullResult.cpp b/src/consumer/PullResult.cpp
index 133f2fe..672f2b3 100644
--- a/src/consumer/PullResult.cpp
+++ b/src/consumer/PullResult.cpp
@@ -21,13 +21,13 @@
 
 #include "UtilAll.h"
 
-namespace rocketmq {
-
 static const char* kPullStatusStrings[] = {"FOUND", "NO_NEW_MSG", "NO_MATCHED_MSG",
                                            "NO_LATEST_MSG"
                                            "OFFSET_ILLEGAL",
                                            "BROKER_TIMEOUT"};
 
+namespace rocketmq {
+
 PullResult::PullResult() : pull_status_(NO_MATCHED_MSG), next_begin_offset_(0), min_offset_(0), max_offset_(0) {}
 
 PullResult::PullResult(PullStatus status)
diff --git a/src/consumer/PullResultExt.h b/src/consumer/PullResultExt.hpp
similarity index 93%
rename from src/consumer/PullResultExt.h
rename to src/consumer/PullResultExt.hpp
index 4bbdc1d..b8840f5 100644
--- a/src/consumer/PullResultExt.h
+++ b/src/consumer/PullResultExt.hpp
@@ -14,9 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "PullResult.h"
+#ifndef ROCKETMQ_CONSUMER_PULLRESULTEXT_HPP_
+#define ROCKETMQ_CONSUMER_PULLRESULTEXT_HPP_
 
 #include "ByteArray.h"
+#include "PullResult.h"
 
 namespace rocketmq {
 
@@ -54,3 +56,5 @@ class PullResultExt : public PullResult {
 };
 
 }  // namespace rocketmq
+
+#endif  // ROCKETMQ_CONSUMER_PULLRESULTEXT_HPP_
diff --git a/src/consumer/RebalanceImpl.cpp b/src/consumer/RebalanceImpl.cpp
index fb24e97..9459d5e 100644
--- a/src/consumer/RebalanceImpl.cpp
+++ b/src/consumer/RebalanceImpl.cpp
@@ -26,33 +26,33 @@ RebalanceImpl::RebalanceImpl(const std::string& consumerGroup,
                              MessageModel messageModel,
                              AllocateMQStrategy* allocateMqStrategy,
                              MQClientInstance* instance)
-    : m_consumerGroup(consumerGroup),
-      m_messageModel(messageModel),
-      m_allocateMQStrategy(allocateMqStrategy),
-      m_clientInstance(instance) {}
+    : consumer_group_(consumerGroup),
+      message_model_(messageModel),
+      allocate_mq_strategy_(allocateMqStrategy),
+      client_instance_(instance) {}
 
 RebalanceImpl::~RebalanceImpl() {
-  for (auto& it : m_subscriptionInner) {
+  for (auto& it : subscription_inner_) {
     deleteAndZero(it.second);
   }
 }
 
 void RebalanceImpl::unlock(MQMessageQueue mq, const bool oneway) {
   std::unique_ptr<FindBrokerResult> findBrokerResult(
-      m_clientInstance->findBrokerAddressInSubscribe(mq.getBrokerName(), MASTER_ID, true));
+      client_instance_->findBrokerAddressInSubscribe(mq.broker_name(), MASTER_ID, true));
   if (findBrokerResult) {
     std::unique_ptr<UnlockBatchRequestBody> unlockBatchRequest(new UnlockBatchRequestBody());
-    unlockBatchRequest->setConsumerGroup(m_consumerGroup);
-    unlockBatchRequest->setClientId(m_clientInstance->getClientId());
+    unlockBatchRequest->setConsumerGroup(consumer_group_);
+    unlockBatchRequest->setClientId(client_instance_->getClientId());
     unlockBatchRequest->getMqSet().push_back(mq);
 
     try {
-      m_clientInstance->getMQClientAPIImpl()->unlockBatchMQ(findBrokerResult->brokerAddr, unlockBatchRequest.get(),
+      client_instance_->getMQClientAPIImpl()->unlockBatchMQ(findBrokerResult->broker_addr(), unlockBatchRequest.get(),
                                                             1000);
 
       ProcessQueuePtr processQueue = getProcessQueue(mq);
       if (processQueue) {
-        processQueue->setLocked(false);
+        processQueue->set_locked(false);
         LOG_INFO("the message queue unlock OK, mq:%s", mq.toString().c_str());
       } else {
         LOG_ERROR("the message queue unlock Failed, mq:%s", mq.toString().c_str());
@@ -61,7 +61,7 @@ void RebalanceImpl::unlock(MQMessageQueue mq, const bool oneway) {
       LOG_ERROR("unlockBatchMQ exception, mq:%s", mq.toString().c_str());
     }
   } else {
-    LOG_WARN("unlock findBrokerAddressInSubscribe ret null for broker:%s", mq.getBrokerName().data());
+    LOG_WARN("unlock findBrokerAddressInSubscribe ret null for broker:%s", mq.broker_name().data());
   }
 }
 
@@ -78,20 +78,20 @@ void RebalanceImpl::unlockAll(const bool oneway) {
     }
 
     std::unique_ptr<FindBrokerResult> findBrokerResult(
-        m_clientInstance->findBrokerAddressInSubscribe(brokerName, MASTER_ID, true));
+        client_instance_->findBrokerAddressInSubscribe(brokerName, MASTER_ID, true));
     if (findBrokerResult) {
       std::unique_ptr<UnlockBatchRequestBody> unlockBatchRequest(new UnlockBatchRequestBody());
-      unlockBatchRequest->setConsumerGroup(m_consumerGroup);
-      unlockBatchRequest->setClientId(m_clientInstance->getClientId());
+      unlockBatchRequest->setConsumerGroup(consumer_group_);
+      unlockBatchRequest->setClientId(client_instance_->getClientId());
       unlockBatchRequest->setMqSet(mqs);
 
       try {
-        m_clientInstance->getMQClientAPIImpl()->unlockBatchMQ(findBrokerResult->brokerAddr, unlockBatchRequest.get(),
+        client_instance_->getMQClientAPIImpl()->unlockBatchMQ(findBrokerResult->broker_addr(), unlockBatchRequest.get(),
                                                               1000);
         for (const auto& mq : mqs) {
           ProcessQueuePtr processQueue = getProcessQueue(mq);
           if (processQueue) {
-            processQueue->setLocked(false);
+            processQueue->set_locked(false);
             LOG_INFO("the message queue unlock OK, mq:%s", mq.toString().c_str());
           } else {
             LOG_ERROR("the message queue unlock Failed, mq:%s", mq.toString().c_str());
@@ -111,7 +111,7 @@ std::shared_ptr<BROKER2MQS> RebalanceImpl::buildProcessQueueTableByBrokerName()
   auto processQueueTable = getProcessQueueTable();
   for (const auto& it : processQueueTable) {
     const auto& mq = it.first;
-    std::string brokerName = mq.getBrokerName();
+    std::string brokerName = mq.broker_name();
     if (brokerMqs->find(brokerName) == brokerMqs->end()) {
       brokerMqs->emplace(brokerName, std::vector<MQMessageQueue>());
     }
@@ -122,18 +122,18 @@ std::shared_ptr<BROKER2MQS> RebalanceImpl::buildProcessQueueTableByBrokerName()
 
 bool RebalanceImpl::lock(MQMessageQueue mq) {
   std::unique_ptr<FindBrokerResult> findBrokerResult(
-      m_clientInstance->findBrokerAddressInSubscribe(mq.getBrokerName(), MASTER_ID, true));
+      client_instance_->findBrokerAddressInSubscribe(mq.broker_name(), MASTER_ID, true));
   if (findBrokerResult) {
     std::unique_ptr<LockBatchRequestBody> lockBatchRequest(new LockBatchRequestBody());
-    lockBatchRequest->setConsumerGroup(m_consumerGroup);
-    lockBatchRequest->setClientId(m_clientInstance->getClientId());
+    lockBatchRequest->setConsumerGroup(consumer_group_);
+    lockBatchRequest->setClientId(client_instance_->getClientId());
     lockBatchRequest->getMqSet().push_back(mq);
 
     try {
       LOG_DEBUG("try to lock mq:%s", mq.toString().c_str());
 
       std::vector<MQMessageQueue> lockedMq;
-      m_clientInstance->getMQClientAPIImpl()->lockBatchMQ(findBrokerResult->brokerAddr, lockBatchRequest.get(),
+      client_instance_->getMQClientAPIImpl()->lockBatchMQ(findBrokerResult->broker_addr(), lockBatchRequest.get(),
                                                           lockedMq, 1000);
 
       bool lockOK = false;
@@ -141,8 +141,8 @@ bool RebalanceImpl::lock(MQMessageQueue mq) {
         for (const auto& mmqq : lockedMq) {
           ProcessQueuePtr processQueue = getProcessQueue(mq);
           if (processQueue) {
-            processQueue->setLocked(true);
-            processQueue->setLastLockTimestamp(UtilAll::currentTimeMillis());
+            processQueue->set_locked(true);
+            processQueue->set_last_lock_timestamp(UtilAll::currentTimeMillis());
             lockOK = true;
             LOG_INFO("the message queue locked OK, mq:%s", mmqq.toString().c_str());
           } else {
@@ -160,7 +160,7 @@ bool RebalanceImpl::lock(MQMessageQueue mq) {
       LOG_ERROR("lockBatchMQ exception, mq:%s", mq.toString().c_str());
     }
   } else {
-    LOG_ERROR("lock findBrokerAddressInSubscribe ret null for broker:%s", mq.getBrokerName().data());
+    LOG_ERROR("lock findBrokerAddressInSubscribe ret null for broker:%s", mq.broker_name().data());
   }
 
   return false;
@@ -179,17 +179,17 @@ void RebalanceImpl::lockAll() {
     }
 
     std::unique_ptr<FindBrokerResult> findBrokerResult(
-        m_clientInstance->findBrokerAddressInSubscribe(brokerName, MASTER_ID, true));
+        client_instance_->findBrokerAddressInSubscribe(brokerName, MASTER_ID, true));
     if (findBrokerResult) {
       std::unique_ptr<LockBatchRequestBody> lockBatchRequest(new LockBatchRequestBody());
-      lockBatchRequest->setConsumerGroup(m_consumerGroup);
-      lockBatchRequest->setClientId(m_clientInstance->getClientId());
+      lockBatchRequest->setConsumerGroup(consumer_group_);
+      lockBatchRequest->setClientId(client_instance_->getClientId());
       lockBatchRequest->setMqSet(mqs);
 
       LOG_INFO("try to lock:" SIZET_FMT " mqs of broker:%s", mqs.size(), brokerName.c_str());
       try {
         std::vector<MQMessageQueue> lockOKMQVec;
-        m_clientInstance->getMQClientAPIImpl()->lockBatchMQ(findBrokerResult->brokerAddr, lockBatchRequest.get(),
+        client_instance_->getMQClientAPIImpl()->lockBatchMQ(findBrokerResult->broker_addr(), lockBatchRequest.get(),
                                                             lockOKMQVec, 1000);
 
         std::set<MQMessageQueue> lockOKMQSet;
@@ -198,8 +198,8 @@ void RebalanceImpl::lockAll() {
 
           ProcessQueuePtr processQueue = getProcessQueue(mq);
           if (processQueue) {
-            processQueue->setLocked(true);
-            processQueue->setLastLockTimestamp(UtilAll::currentTimeMillis());
+            processQueue->set_locked(true);
+            processQueue->set_last_lock_timestamp(UtilAll::currentTimeMillis());
             LOG_INFO("the message queue locked OK, mq:%s", mq.toString().c_str());
           } else {
             LOG_WARN("the message queue locked OK, but it is released, mq:%s", mq.toString().c_str());
@@ -211,7 +211,7 @@ void RebalanceImpl::lockAll() {
             ProcessQueuePtr processQueue = getProcessQueue(mq);
             if (processQueue) {
               LOG_WARN("the message queue locked Failed, mq:%s", mq.toString().c_str());
-              processQueue->setLocked(false);
+              processQueue->set_locked(false);
             }
           }
         }
@@ -226,7 +226,7 @@ void RebalanceImpl::lockAll() {
 
 void RebalanceImpl::doRebalance(const bool isOrder) {
   LOG_DEBUG("start doRebalance");
-  for (const auto& it : m_subscriptionInner) {
+  for (const auto& it : subscription_inner_) {
     const std::string& topic = it.first;
     LOG_INFO("current topic is:%s", topic.c_str());
     try {
@@ -241,7 +241,7 @@ void RebalanceImpl::doRebalance(const bool isOrder) {
 
 void RebalanceImpl::rebalanceByTopic(const std::string& topic, const bool isOrder) {
   // msg model
-  switch (m_messageModel) {
+  switch (message_model_) {
     case BROADCASTING: {
       std::vector<MQMessageQueue> mqSet;
       if (!getTopicSubscribeInfo(topic, mqSet)) {
@@ -250,23 +250,23 @@ void RebalanceImpl::rebalanceByTopic(const std::string& topic, const bool isOrde
           messageQueueChanged(topic, mqSet, mqSet);
         }
       } else {
-        LOG_WARN("doRebalance, %s, but the topic[%s] not exist.", m_consumerGroup.c_str(), topic.c_str());
+        LOG_WARN("doRebalance, %s, but the topic[%s] not exist.", consumer_group_.c_str(), topic.c_str());
       }
     } break;
     case CLUSTERING: {
       std::vector<MQMessageQueue> mqAll;
       if (!getTopicSubscribeInfo(topic, mqAll)) {
         if (!UtilAll::isRetryTopic(topic)) {
-          LOG_WARN("doRebalance, %s, but the topic[%s] not exist.", m_consumerGroup.c_str(), topic.c_str());
+          LOG_WARN("doRebalance, %s, but the topic[%s] not exist.", consumer_group_.c_str(), topic.c_str());
         }
         return;
       }
 
       std::vector<std::string> cidAll;
-      m_clientInstance->findConsumerIds(topic, m_consumerGroup, cidAll);
+      client_instance_->findConsumerIds(topic, consumer_group_, cidAll);
 
       if (cidAll.empty()) {
-        LOG_WARN("doRebalance, %s %s, get consumer id list failed", m_consumerGroup.c_str(), topic.c_str());
+        LOG_WARN("doRebalance, %s %s, get consumer id list failed", consumer_group_.c_str(), topic.c_str());
         return;
       }
 
@@ -282,7 +282,7 @@ void RebalanceImpl::rebalanceByTopic(const std::string& topic, const bool isOrde
       // allocate mqs
       std::vector<MQMessageQueue> allocateResult;
       try {
-        m_allocateMQStrategy->allocate(m_clientInstance->getClientId(), mqAll, cidAll, allocateResult);
+        allocate_mq_strategy_->allocate(client_instance_->getClientId(), mqAll, cidAll, allocateResult);
       } catch (MQException& e) {
         LOG_ERROR("AllocateMessageQueueStrategy.allocate Exception: %s", e.what());
         return;
@@ -293,7 +293,7 @@ void RebalanceImpl::rebalanceByTopic(const std::string& topic, const bool isOrde
       if (changed) {
         LOG_INFO("rebalanced result changed. group=%s, topic=%s, clientId=%s, mqAllSize=" SIZET_FMT
                  ", cidAllSize=" SIZET_FMT ", rebalanceResultSize=" SIZET_FMT ", rebalanceResultSet:",
-                 m_consumerGroup.c_str(), topic.c_str(), m_clientInstance->getClientId().c_str(), mqAll.size(),
+                 consumer_group_.c_str(), topic.c_str(), client_instance_->getClientId().c_str(), mqAll.size(),
                  cidAll.size(), allocateResult.size());
         for (auto& mq : allocateResult) {
           LOG_INFO("allocate mq:%s", mq.toString().c_str());
@@ -310,11 +310,11 @@ void RebalanceImpl::truncateMessageQueueNotMyTopic() {
   auto& subTable = getSubscriptionInner();
   std::vector<MQMessageQueue> mqs = getAllocatedMQ();
   for (const auto& mq : mqs) {
-    if (subTable.find(mq.getTopic()) == subTable.end()) {
+    if (subTable.find(mq.topic()) == subTable.end()) {
       auto pq = removeProcessQueueDirectly(mq);
       if (pq != nullptr) {
-        pq->setDropped(true);
-        LOG_INFO("doRebalance, %s, truncateMessageQueueNotMyTopic remove unnecessary mq, {}", m_consumerGroup.c_str(),
+        pq->set_dropped(true);
+        LOG_INFO("doRebalance, %s, truncateMessageQueueNotMyTopic remove unnecessary mq, {}", consumer_group_.c_str(),
                  mq.toString().c_str());
       }
     }
@@ -329,30 +329,30 @@ bool RebalanceImpl::updateProcessQueueTableInRebalance(const std::string& topic,
   bool changed = false;
 
   // remove
-  MQ2PQ processQueueTable(getProcessQueueTable());  // get copy of m_processQueueTable
+  MQ2PQ processQueueTable(getProcessQueueTable());  // get copy of process_queue_table_
   for (const auto& it : processQueueTable) {
     const auto& mq = it.first;
     auto pq = it.second;
 
-    if (mq.getTopic() == topic) {
+    if (mq.topic() == topic) {
       if (mqSet.empty() || (find(mqSet.begin(), mqSet.end(), mq) == mqSet.end())) {
-        pq->setDropped(true);
+        pq->set_dropped(true);
         if (removeUnnecessaryMessageQueue(mq, pq)) {
           removeProcessQueueDirectly(mq);
           changed = true;
-          LOG_INFO("doRebalance, %s, remove unnecessary mq, %s", m_consumerGroup.c_str(), mq.toString().c_str());
+          LOG_INFO("doRebalance, %s, remove unnecessary mq, %s", consumer_group_.c_str(), mq.toString().c_str());
... 6921 lines suppressed ...