rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq-client-cpp] branch master updated: fix(send): try to use command v2 to send messages (#225)
Date Sat, 11 Jan 2020 10:21:05 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new b50d99c  fix(send): try to use command v2 to send messages (#225)
b50d99c is described below

commit b50d99cae1bbaac24848ee668393f0568fa2e686
Author: dinglei <libya_003@163.com>
AuthorDate: Sat Jan 11 18:20:54 2020 +0800

    fix(send): try to use command v2 to send messages (#225)
    
    [fix #189]
    * fix(send): try to use command v2 to send messages
    
    * fix(send): try to use command v2 to send messages
    
    * fix(send): try to use command v2 to send messages
    
    * fix(send): try to use command v2 to send messages
    
    * fix(send): try to use command v2 to send messages
    
    * fix(send): try to use command v2 to send messages
    
    * fix(send): try to use command v2 to send messages
---
 src/MQClientAPIImpl.cpp                            |    6 +-
 src/MQClientFactory.cpp                            |    5 +-
 src/common/AsyncCallbackWrap.cpp                   |    1 -
 src/common/AsyncCallbackWrap.h                     |    7 +-
 src/common/MQVersion.cpp                           |   18 +-
 src/common/MQVersion.h                             | 1314 +++++++++++++++++++-
 src/common/VirtualEnvUtil.cpp                      |    6 +-
 src/producer/DefaultMQProducer.cpp                 |    1 +
 src/protocol/CommandHeader.cpp                     |   66 +-
 src/protocol/CommandHeader.h                       |   44 +-
 src/protocol/RemotingCommand.cpp                   |    9 +-
 .../{VirtualEnvUtilTest.cpp => MQVersionTest.cpp}  |   32 +-
 test/src/common/VirtualEnvUtilTest.cpp             |   33 +-
 test/src/protocol/CommandHeaderTest.cpp            |   73 +-
 14 files changed, 1549 insertions(+), 66 deletions(-)

diff --git a/src/MQClientAPIImpl.cpp b/src/MQClientAPIImpl.cpp
index 7520eb5..26ab1b0 100644
--- a/src/MQClientAPIImpl.cpp
+++ b/src/MQClientAPIImpl.cpp
@@ -230,7 +230,11 @@ SendResult MQClientAPIImpl::sendMessage(const string& addr,
                                         int communicationMode,
                                         SendCallback* pSendCallback,
                                         const SessionCredentials& sessionCredentials) {
-  RemotingCommand request(SEND_MESSAGE, pRequestHeader);
+  // RemotingCommand request(SEND_MESSAGE, pRequestHeader);
+  // Using MQ V2 Protocol to end messages.
+  SendMessageRequestHeaderV2* pRequestHeaderV2 = new SendMessageRequestHeaderV2(*pRequestHeader);
+  RemotingCommand request(SEND_MESSAGE_V2, pRequestHeaderV2);
+  delete pRequestHeader;  // delete to avoid memory leak.
   string body = msg.getBody();
   request.SetBody(body.c_str(), body.length());
   request.setMsgBody(body);
diff --git a/src/MQClientFactory.cpp b/src/MQClientFactory.cpp
index 6315cb1..4d64aa0 100644
--- a/src/MQClientFactory.cpp
+++ b/src/MQClientFactory.cpp
@@ -18,6 +18,7 @@
 #include "ConsumerRunningInfo.h"
 #include "Logging.h"
 #include "MQClientManager.h"
+#include "MQVersion.h"
 #include "PullRequest.h"
 #include "Rebalance.h"
 #include "TopicPublishInfo.h"
@@ -1161,7 +1162,9 @@ ConsumerRunningInfo* MQClientFactory::consumerRunningInfo(const string& consumer
       } else {
         runningInfo->setProperty(ConsumerRunningInfo::PROP_CONSUME_TYPE, "CONSUME_ACTIVELY");
       }
-      runningInfo->setProperty(ConsumerRunningInfo::PROP_CLIENT_VERSION, "V3_1_8");  // MQVersion::s_CurrentVersion ));
+      runningInfo->setProperty(
+          ConsumerRunningInfo::PROP_CLIENT_VERSION,
+          MQVersion::GetVersionDesc(MQVersion::s_CurrentVersion));  // MQVersion::s_CurrentVersion ));
 
       return runningInfo;
     }
diff --git a/src/common/AsyncCallbackWrap.cpp b/src/common/AsyncCallbackWrap.cpp
old mode 100755
new mode 100644
index cb26fda..cffa219
--- a/src/common/AsyncCallbackWrap.cpp
+++ b/src/common/AsyncCallbackWrap.cpp
@@ -20,7 +20,6 @@
 #include "MQClientAPIImpl.h"
 #include "MQDecoder.h"
 #include "MQMessageQueue.h"
-#include "MQProtos.h"
 #include "PullAPIWrapper.h"
 #include "PullResultExt.h"
 #include "ResponseFuture.h"
diff --git a/src/common/AsyncCallbackWrap.h b/src/common/AsyncCallbackWrap.h
index 9b202a8..c4b3f66 100644
--- a/src/common/AsyncCallbackWrap.h
+++ b/src/common/AsyncCallbackWrap.h
@@ -20,15 +20,14 @@
 #include "AsyncArg.h"
 #include "AsyncCallback.h"
 #include "MQMessage.h"
-#include "UtilAll.h"
 #include "RemotingCommand.h"
+#include "UtilAll.h"
 
 namespace rocketmq {
 
 class ResponseFuture;
 class MQClientAPIImpl;
 class DefaultMQProducer;
-class SendMessageRequestHeader;
 //<!***************************************************************************
 enum asyncCallBackType { asyncCallbackWrap = 0, sendCallbackWrap = 1, pullCallbackWarp = 2 };
 
@@ -77,5 +76,5 @@ class PullCallbackWarp : public AsyncCallbackWrap {
 };
 
 //<!***************************************************************************
-}  //<!end namespace;
-#endif  //<! _AsyncCallbackWrap_H_
+}  // namespace rocketmq
+#endif  // __ASYNCCALLBACKWRAP_H__
diff --git a/src/common/MQVersion.cpp b/src/common/MQVersion.cpp
index 015390c..5c0c789 100644
--- a/src/common/MQVersion.cpp
+++ b/src/common/MQVersion.cpp
@@ -17,15 +17,19 @@
 #include "MQVersion.h"
 
 namespace rocketmq {
-int MQVersion::s_CurrentVersion = MQVersion::V3_1_8;
+int MQVersion::s_CurrentVersion = MQVersion::V4_6_0;
+std::string MQVersion::s_CurrentLanguage = "CPP";
 
 //<!************************************************************************
-const char* MQVersion::getVersionDesc(int value) {
-  switch (value) {
-    // case V1_0_0:
-    // return "V1_0_0";
+const char* MQVersion::GetVersionDesc(int value) {
+  int currentVersion = value;
+  if (value <= V3_0_0_SNAPSHOT) {
+    currentVersion = V3_0_0_SNAPSHOT;
   }
-  return "";
+  if (value >= HIGHER_VERSION) {
+    currentVersion = HIGHER_VERSION;
+  }
+  return RocketMQCPPClientVersion[currentVersion];
 }
 //<!***************************************************************************
-}  //<!end namespace;
+}  // namespace rocketmq
diff --git a/src/common/MQVersion.h b/src/common/MQVersion.h
index aa9e9cd..d36eab0 100644
--- a/src/common/MQVersion.h
+++ b/src/common/MQVersion.h
@@ -21,6 +21,604 @@
 
 namespace rocketmq {
 //<!***************************************************************************
+
+static const char* RocketMQCPPClientVersion[] = {"V3_0_0_SNAPSHOT",  "V3_0_0_ALPHA1",
+                                                 "V3_0_0_BETA1",     "V3_0_0_BETA2",
+                                                 "V3_0_0_BETA3",     "V3_0_0_BETA4",
+                                                 "V3_0_0_BETA5",     "V3_0_0_BETA6_SNAPSHOT",
+                                                 "V3_0_0_BETA6",     "V3_0_0_BETA7_SNAPSHOT",
+                                                 "V3_0_0_BETA7",     "V3_0_0_BETA8_SNAPSHOT",
+                                                 "V3_0_0_BETA8",     "V3_0_0_BETA9_SNAPSHOT",
+                                                 "V3_0_0_BETA9",     "V3_0_0_FINAL",
+                                                 "V3_0_1_SNAPSHOT",  "V3_0_1",
+                                                 "V3_0_2_SNAPSHOT",  "V3_0_2",
+                                                 "V3_0_3_SNAPSHOT",  "V3_0_3",
+                                                 "V3_0_4_SNAPSHOT",  "V3_0_4",
+                                                 "V3_0_5_SNAPSHOT",  "V3_0_5",
+                                                 "V3_0_6_SNAPSHOT",  "V3_0_6",
+                                                 "V3_0_7_SNAPSHOT",  "V3_0_7",
+                                                 "V3_0_8_SNAPSHOT",  "V3_0_8",
+                                                 "V3_0_9_SNAPSHOT",  "V3_0_9",
+
+                                                 "V3_0_10_SNAPSHOT", "V3_0_10",
+
+                                                 "V3_0_11_SNAPSHOT", "V3_0_11",
+
+                                                 "V3_0_12_SNAPSHOT", "V3_0_12",
+
+                                                 "V3_0_13_SNAPSHOT", "V3_0_13",
+
+                                                 "V3_0_14_SNAPSHOT", "V3_0_14",
+
+                                                 "V3_0_15_SNAPSHOT", "V3_0_15",
+
+                                                 "V3_1_0_SNAPSHOT",  "V3_1_0",
+
+                                                 "V3_1_1_SNAPSHOT",  "V3_1_1",
+
+                                                 "V3_1_2_SNAPSHOT",  "V3_1_2",
+
+                                                 "V3_1_3_SNAPSHOT",  "V3_1_3",
+
+                                                 "V3_1_4_SNAPSHOT",  "V3_1_4",
+
+                                                 "V3_1_5_SNAPSHOT",  "V3_1_5",
+
+                                                 "V3_1_6_SNAPSHOT",  "V3_1_6",
+
+                                                 "V3_1_7_SNAPSHOT",  "V3_1_7",
+
+                                                 "V3_1_8_SNAPSHOT",  "V3_1_8",
+
+                                                 "V3_1_9_SNAPSHOT",  "V3_1_9",
+
+                                                 "V3_2_0_SNAPSHOT",  "V3_2_0",
+
+                                                 "V3_2_1_SNAPSHOT",  "V3_2_1",
+
+                                                 "V3_2_2_SNAPSHOT",  "V3_2_2",
+
+                                                 "V3_2_3_SNAPSHOT",  "V3_2_3",
+
+                                                 "V3_2_4_SNAPSHOT",  "V3_2_4",
+
+                                                 "V3_2_5_SNAPSHOT",  "V3_2_5",
+
+                                                 "V3_2_6_SNAPSHOT",  "V3_2_6",
+
+                                                 "V3_2_7_SNAPSHOT",  "V3_2_7",
+
+                                                 "V3_2_8_SNAPSHOT",  "V3_2_8",
+
+                                                 "V3_2_9_SNAPSHOT",  "V3_2_9",
+
+                                                 "V3_3_1_SNAPSHOT",  "V3_3_1",
+
+                                                 "V3_3_2_SNAPSHOT",  "V3_3_2",
+
+                                                 "V3_3_3_SNAPSHOT",  "V3_3_3",
+
+                                                 "V3_3_4_SNAPSHOT",  "V3_3_4",
+
+                                                 "V3_3_5_SNAPSHOT",  "V3_3_5",
+
+                                                 "V3_3_6_SNAPSHOT",  "V3_3_6",
+
+                                                 "V3_3_7_SNAPSHOT",  "V3_3_7",
+
+                                                 "V3_3_8_SNAPSHOT",  "V3_3_8",
+
+                                                 "V3_3_9_SNAPSHOT",  "V3_3_9",
+
+                                                 "V3_4_1_SNAPSHOT",  "V3_4_1",
+
+                                                 "V3_4_2_SNAPSHOT",  "V3_4_2",
+
+                                                 "V3_4_3_SNAPSHOT",  "V3_4_3",
+
+                                                 "V3_4_4_SNAPSHOT",  "V3_4_4",
+
+                                                 "V3_4_5_SNAPSHOT",  "V3_4_5",
+
+                                                 "V3_4_6_SNAPSHOT",  "V3_4_6",
+
+                                                 "V3_4_7_SNAPSHOT",  "V3_4_7",
+
+                                                 "V3_4_8_SNAPSHOT",  "V3_4_8",
+
+                                                 "V3_4_9_SNAPSHOT",  "V3_4_9",
+                                                 "V3_5_1_SNAPSHOT",  "V3_5_1",
+
+                                                 "V3_5_2_SNAPSHOT",  "V3_5_2",
+
+                                                 "V3_5_3_SNAPSHOT",  "V3_5_3",
+
+                                                 "V3_5_4_SNAPSHOT",  "V3_5_4",
+
+                                                 "V3_5_5_SNAPSHOT",  "V3_5_5",
+
+                                                 "V3_5_6_SNAPSHOT",  "V3_5_6",
+
+                                                 "V3_5_7_SNAPSHOT",  "V3_5_7",
+
+                                                 "V3_5_8_SNAPSHOT",  "V3_5_8",
+
+                                                 "V3_5_9_SNAPSHOT",  "V3_5_9",
+
+                                                 "V3_6_1_SNAPSHOT",  "V3_6_1",
+
+                                                 "V3_6_2_SNAPSHOT",  "V3_6_2",
+
+                                                 "V3_6_3_SNAPSHOT",  "V3_6_3",
+
+                                                 "V3_6_4_SNAPSHOT",  "V3_6_4",
+
+                                                 "V3_6_5_SNAPSHOT",  "V3_6_5",
+
+                                                 "V3_6_6_SNAPSHOT",  "V3_6_6",
+
+                                                 "V3_6_7_SNAPSHOT",  "V3_6_7",
+
+                                                 "V3_6_8_SNAPSHOT",  "V3_6_8",
+
+                                                 "V3_6_9_SNAPSHOT",  "V3_6_9",
+
+                                                 "V3_7_1_SNAPSHOT",  "V3_7_1",
+
+                                                 "V3_7_2_SNAPSHOT",  "V3_7_2",
+
+                                                 "V3_7_3_SNAPSHOT",  "V3_7_3",
+
+                                                 "V3_7_4_SNAPSHOT",  "V3_7_4",
+
+                                                 "V3_7_5_SNAPSHOT",  "V3_7_5",
+
+                                                 "V3_7_6_SNAPSHOT",  "V3_7_6",
+
+                                                 "V3_7_7_SNAPSHOT",  "V3_7_7",
+
+                                                 "V3_7_8_SNAPSHOT",  "V3_7_8",
+
+                                                 "V3_7_9_SNAPSHOT",  "V3_7_9",
+
+                                                 "V3_8_1_SNAPSHOT",  "V3_8_1",
+
+                                                 "V3_8_2_SNAPSHOT",  "V3_8_2",
+
+                                                 "V3_8_3_SNAPSHOT",  "V3_8_3",
+
+                                                 "V3_8_4_SNAPSHOT",  "V3_8_4",
+
+                                                 "V3_8_5_SNAPSHOT",  "V3_8_5",
+
+                                                 "V3_8_6_SNAPSHOT",  "V3_8_6",
+
+                                                 "V3_8_7_SNAPSHOT",  "V3_8_7",
+
+                                                 "V3_8_8_SNAPSHOT",  "V3_8_8",
+
+                                                 "V3_8_9_SNAPSHOT",  "V3_8_9",
+
+                                                 "V3_9_1_SNAPSHOT",  "V3_9_1",
+
+                                                 "V3_9_2_SNAPSHOT",  "V3_9_2",
+
+                                                 "V3_9_3_SNAPSHOT",  "V3_9_3",
+
+                                                 "V3_9_4_SNAPSHOT",  "V3_9_4",
+
+                                                 "V3_9_5_SNAPSHOT",  "V3_9_5",
+
+                                                 "V3_9_6_SNAPSHOT",  "V3_9_6",
+
+                                                 "V3_9_7_SNAPSHOT",  "V3_9_7",
+
+                                                 "V3_9_8_SNAPSHOT",  "V3_9_8",
+
+                                                 "V3_9_9_SNAPSHOT",  "V3_9_9",
+
+                                                 "V4_0_0_SNAPSHOT",  "V4_0_0",
+
+                                                 "V4_0_1_SNAPSHOT",  "V4_0_1",
+
+                                                 "V4_0_2_SNAPSHOT",  "V4_0_2",
+
+                                                 "V4_0_3_SNAPSHOT",  "V4_0_3",
+
+                                                 "V4_0_4_SNAPSHOT",  "V4_0_4",
+
+                                                 "V4_0_5_SNAPSHOT",  "V4_0_5",
+
+                                                 "V4_0_6_SNAPSHOT",  "V4_0_6",
+
+                                                 "V4_0_7_SNAPSHOT",  "V4_0_7",
+
+                                                 "V4_0_8_SNAPSHOT",  "V4_0_8",
+
+                                                 "V4_0_9_SNAPSHOT",  "V4_0_9",
+
+                                                 "V4_1_0_SNAPSHOT",  "V4_1_0",
+
+                                                 "V4_1_1_SNAPSHOT",  "V4_1_1",
+
+                                                 "V4_1_2_SNAPSHOT",  "V4_1_2",
+
+                                                 "V4_1_3_SNAPSHOT",  "V4_1_3",
+
+                                                 "V4_1_4_SNAPSHOT",  "V4_1_4",
+
+                                                 "V4_1_5_SNAPSHOT",  "V4_1_5",
+
+                                                 "V4_1_6_SNAPSHOT",  "V4_1_6",
+
+                                                 "V4_1_7_SNAPSHOT",  "V4_1_7",
+
+                                                 "V4_1_8_SNAPSHOT",  "V4_1_8",
+
+                                                 "V4_1_9_SNAPSHOT",  "V4_1_9",
+
+                                                 "V4_2_0_SNAPSHOT",  "V4_2_0",
+
+                                                 "V4_2_1_SNAPSHOT",  "V4_2_1",
+
+                                                 "V4_2_2_SNAPSHOT",  "V4_2_2",
+
+                                                 "V4_2_3_SNAPSHOT",  "V4_2_3",
+
+                                                 "V4_2_4_SNAPSHOT",  "V4_2_4",
+
+                                                 "V4_2_5_SNAPSHOT",  "V4_2_5",
+
+                                                 "V4_2_6_SNAPSHOT",  "V4_2_6",
+
+                                                 "V4_2_7_SNAPSHOT",  "V4_2_7",
+
+                                                 "V4_2_8_SNAPSHOT",  "V4_2_8",
+
+                                                 "V4_2_9_SNAPSHOT",  "V4_2_9",
+
+                                                 "V4_3_0_SNAPSHOT",  "V4_3_0",
+
+                                                 "V4_3_1_SNAPSHOT",  "V4_3_1",
+
+                                                 "V4_3_2_SNAPSHOT",  "V4_3_2",
+
+                                                 "V4_3_3_SNAPSHOT",  "V4_3_3",
+
+                                                 "V4_3_4_SNAPSHOT",  "V4_3_4",
+
+                                                 "V4_3_5_SNAPSHOT",  "V4_3_5",
+
+                                                 "V4_3_6_SNAPSHOT",  "V4_3_6",
+
+                                                 "V4_3_7_SNAPSHOT",  "V4_3_7",
+
+                                                 "V4_3_8_SNAPSHOT",  "V4_3_8",
+
+                                                 "V4_3_9_SNAPSHOT",  "V4_3_9",
+
+                                                 "V4_4_0_SNAPSHOT",  "V4_4_0",
+
+                                                 "V4_4_1_SNAPSHOT",  "V4_4_1",
+
+                                                 "V4_4_2_SNAPSHOT",  "V4_4_2",
+
+                                                 "V4_4_3_SNAPSHOT",  "V4_4_3",
+
+                                                 "V4_4_4_SNAPSHOT",  "V4_4_4",
+
+                                                 "V4_4_5_SNAPSHOT",  "V4_4_5",
+
+                                                 "V4_4_6_SNAPSHOT",  "V4_4_6",
+
+                                                 "V4_4_7_SNAPSHOT",  "V4_4_7",
+
+                                                 "V4_4_8_SNAPSHOT",  "V4_4_8",
+
+                                                 "V4_4_9_SNAPSHOT",  "V4_4_9",
+
+                                                 "V4_5_0_SNAPSHOT",  "V4_5_0",
+
+                                                 "V4_5_1_SNAPSHOT",  "V4_5_1",
+
+                                                 "V4_5_2_SNAPSHOT",  "V4_5_2",
+
+                                                 "V4_5_3_SNAPSHOT",  "V4_5_3",
+
+                                                 "V4_5_4_SNAPSHOT",  "V4_5_4",
+
+                                                 "V4_5_5_SNAPSHOT",  "V4_5_5",
+
+                                                 "V4_5_6_SNAPSHOT",  "V4_5_6",
+
+                                                 "V4_5_7_SNAPSHOT",  "V4_5_7",
+
+                                                 "V4_5_8_SNAPSHOT",  "V4_5_8",
+
+                                                 "V4_5_9_SNAPSHOT",  "V4_5_9",
+
+                                                 "V4_6_0_SNAPSHOT",  "V4_6_0",
+
+                                                 "V4_6_1_SNAPSHOT",  "V4_6_1",
+
+                                                 "V4_6_2_SNAPSHOT",  "V4_6_2",
+
+                                                 "V4_6_3_SNAPSHOT",  "V4_6_3",
+
+                                                 "V4_6_4_SNAPSHOT",  "V4_6_4",
+
+                                                 "V4_6_5_SNAPSHOT",  "V4_6_5",
+
+                                                 "V4_6_6_SNAPSHOT",  "V4_6_6",
+
+                                                 "V4_6_7_SNAPSHOT",  "V4_6_7",
+
+                                                 "V4_6_8_SNAPSHOT",  "V4_6_8",
+
+                                                 "V4_6_9_SNAPSHOT",  "V4_6_9",
+
+                                                 "V4_7_0_SNAPSHOT",  "V4_7_0",
+
+                                                 "V4_7_1_SNAPSHOT",  "V4_7_1",
+
+                                                 "V4_7_2_SNAPSHOT",  "V4_7_2",
+
+                                                 "V4_7_3_SNAPSHOT",  "V4_7_3",
+
+                                                 "V4_7_4_SNAPSHOT",  "V4_7_4",
+
+                                                 "V4_7_5_SNAPSHOT",  "V4_7_5",
+
+                                                 "V4_7_6_SNAPSHOT",  "V4_7_6",
+
+                                                 "V4_7_7_SNAPSHOT",  "V4_7_7",
+
+                                                 "V4_7_8_SNAPSHOT",  "V4_7_8",
+
+                                                 "V4_7_9_SNAPSHOT",  "V4_7_9",
+
+                                                 "V4_8_0_SNAPSHOT",  "V4_8_0",
+
+                                                 "V4_8_1_SNAPSHOT",  "V4_8_1",
+
+                                                 "V4_8_2_SNAPSHOT",  "V4_8_2",
+
+                                                 "V4_8_3_SNAPSHOT",  "V4_8_3",
+
+                                                 "V4_8_4_SNAPSHOT",  "V4_8_4",
+
+                                                 "V4_8_5_SNAPSHOT",  "V4_8_5",
+
+                                                 "V4_8_6_SNAPSHOT",  "V4_8_6",
+
+                                                 "V4_8_7_SNAPSHOT",  "V4_8_7",
+
+                                                 "V4_8_8_SNAPSHOT",  "V4_8_8",
+
+                                                 "V4_8_9_SNAPSHOT",  "V4_8_9",
+
+                                                 "V4_9_0_SNAPSHOT",  "V4_9_0",
+
+                                                 "V4_9_1_SNAPSHOT",  "V4_9_1",
+
+                                                 "V4_9_2_SNAPSHOT",  "V4_9_2",
+
+                                                 "V4_9_3_SNAPSHOT",  "V4_9_3",
+
+                                                 "V4_9_4_SNAPSHOT",  "V4_9_4",
+
+                                                 "V4_9_5_SNAPSHOT",  "V4_9_5",
+
+                                                 "V4_9_6_SNAPSHOT",  "V4_9_6",
+
+                                                 "V4_9_7_SNAPSHOT",  "V4_9_7",
+
+                                                 "V4_9_8_SNAPSHOT",  "V4_9_8",
+
+                                                 "V4_9_9_SNAPSHOT",  "V4_9_9",
+
+                                                 "V5_0_0_SNAPSHOT",  "V5_0_0",
+
+                                                 "V5_0_1_SNAPSHOT",  "V5_0_1",
+
+                                                 "V5_0_2_SNAPSHOT",  "V5_0_2",
+
+                                                 "V5_0_3_SNAPSHOT",  "V5_0_3",
+
+                                                 "V5_0_4_SNAPSHOT",  "V5_0_4",
+
+                                                 "V5_0_5_SNAPSHOT",  "V5_0_5",
+
+                                                 "V5_0_6_SNAPSHOT",  "V5_0_6",
+
+                                                 "V5_0_7_SNAPSHOT",  "V5_0_7",
+
+                                                 "V5_0_8_SNAPSHOT",  "V5_0_8",
+
+                                                 "V5_0_9_SNAPSHOT",  "V5_0_9",
+
+                                                 "V5_1_0_SNAPSHOT",  "V5_1_0",
+
+                                                 "V5_1_1_SNAPSHOT",  "V5_1_1",
+
+                                                 "V5_1_2_SNAPSHOT",  "V5_1_2",
+
+                                                 "V5_1_3_SNAPSHOT",  "V5_1_3",
+
+                                                 "V5_1_4_SNAPSHOT",  "V5_1_4",
+
+                                                 "V5_1_5_SNAPSHOT",  "V5_1_5",
+
+                                                 "V5_1_6_SNAPSHOT",  "V5_1_6",
+
+                                                 "V5_1_7_SNAPSHOT",  "V5_1_7",
+
+                                                 "V5_1_8_SNAPSHOT",  "V5_1_8",
+
+                                                 "V5_1_9_SNAPSHOT",  "V5_1_9",
+
+                                                 "V5_2_0_SNAPSHOT",  "V5_2_0",
+
+                                                 "V5_2_1_SNAPSHOT",  "V5_2_1",
+
+                                                 "V5_2_2_SNAPSHOT",  "V5_2_2",
+
+                                                 "V5_2_3_SNAPSHOT",  "V5_2_3",
+
+                                                 "V5_2_4_SNAPSHOT",  "V5_2_4",
+
+                                                 "V5_2_5_SNAPSHOT",  "V5_2_5",
+
+                                                 "V5_2_6_SNAPSHOT",  "V5_2_6",
+
+                                                 "V5_2_7_SNAPSHOT",  "V5_2_7",
+
+                                                 "V5_2_8_SNAPSHOT",  "V5_2_8",
+
+                                                 "V5_2_9_SNAPSHOT",  "V5_2_9",
+
+                                                 "V5_3_0_SNAPSHOT",  "V5_3_0",
+
+                                                 "V5_3_1_SNAPSHOT",  "V5_3_1",
+
+                                                 "V5_3_2_SNAPSHOT",  "V5_3_2",
+
+                                                 "V5_3_3_SNAPSHOT",  "V5_3_3",
+
+                                                 "V5_3_4_SNAPSHOT",  "V5_3_4",
+
+                                                 "V5_3_5_SNAPSHOT",  "V5_3_5",
+
+                                                 "V5_3_6_SNAPSHOT",  "V5_3_6",
+
+                                                 "V5_3_7_SNAPSHOT",  "V5_3_7",
+
+                                                 "V5_3_8_SNAPSHOT",  "V5_3_8",
+
+                                                 "V5_3_9_SNAPSHOT",  "V5_3_9",
+
+                                                 "V5_4_0_SNAPSHOT",  "V5_4_0",
+
+                                                 "V5_4_1_SNAPSHOT",  "V5_4_1",
+
+                                                 "V5_4_2_SNAPSHOT",  "V5_4_2",
+
+                                                 "V5_4_3_SNAPSHOT",  "V5_4_3",
+
+                                                 "V5_4_4_SNAPSHOT",  "V5_4_4",
+
+                                                 "V5_4_5_SNAPSHOT",  "V5_4_5",
+
+                                                 "V5_4_6_SNAPSHOT",  "V5_4_6",
+
+                                                 "V5_4_7_SNAPSHOT",  "V5_4_7",
+
+                                                 "V5_4_8_SNAPSHOT",  "V5_4_8",
+
+                                                 "V5_4_9_SNAPSHOT",  "V5_4_9",
+
+                                                 "V5_5_0_SNAPSHOT",  "V5_5_0",
+
+                                                 "V5_5_1_SNAPSHOT",  "V5_5_1",
+
+                                                 "V5_5_2_SNAPSHOT",  "V5_5_2",
+
+                                                 "V5_5_3_SNAPSHOT",  "V5_5_3",
+
+                                                 "V5_5_4_SNAPSHOT",  "V5_5_4",
+
+                                                 "V5_5_5_SNAPSHOT",  "V5_5_5",
+
+                                                 "V5_5_6_SNAPSHOT",  "V5_5_6",
+
+                                                 "V5_5_7_SNAPSHOT",  "V5_5_7",
+
+                                                 "V5_5_8_SNAPSHOT",  "V5_5_8",
+
+                                                 "V5_5_9_SNAPSHOT",  "V5_5_9",
+
+                                                 "V5_6_0_SNAPSHOT",  "V5_6_0",
+
+                                                 "V5_6_1_SNAPSHOT",  "V5_6_1",
+
+                                                 "V5_6_2_SNAPSHOT",  "V5_6_2",
+
+                                                 "V5_6_3_SNAPSHOT",  "V5_6_3",
+
+                                                 "V5_6_4_SNAPSHOT",  "V5_6_4",
+
+                                                 "V5_6_5_SNAPSHOT",  "V5_6_5",
+
+                                                 "V5_6_6_SNAPSHOT",  "V5_6_6",
+
+                                                 "V5_6_7_SNAPSHOT",  "V5_6_7",
+
+                                                 "V5_6_8_SNAPSHOT",  "V5_6_8",
+
+                                                 "V5_6_9_SNAPSHOT",  "V5_6_9",
+
+                                                 "V5_7_0_SNAPSHOT",  "V5_7_0",
+
+                                                 "V5_7_1_SNAPSHOT",  "V5_7_1",
+
+                                                 "V5_7_2_SNAPSHOT",  "V5_7_2",
+
+                                                 "V5_7_3_SNAPSHOT",  "V5_7_3",
+
+                                                 "V5_7_4_SNAPSHOT",  "V5_7_4",
+
+                                                 "V5_7_5_SNAPSHOT",  "V5_7_5",
+
+                                                 "V5_7_6_SNAPSHOT",  "V5_7_6",
+
+                                                 "V5_7_7_SNAPSHOT",  "V5_7_7",
+
+                                                 "V5_7_8_SNAPSHOT",  "V5_7_8",
+
+                                                 "V5_7_9_SNAPSHOT",  "V5_7_9",
+
+                                                 "V5_8_0_SNAPSHOT",  "V5_8_0",
+
+                                                 "V5_8_1_SNAPSHOT",  "V5_8_1",
+
+                                                 "V5_8_2_SNAPSHOT",  "V5_8_2",
+
+                                                 "V5_8_3_SNAPSHOT",  "V5_8_3",
+
+                                                 "V5_8_4_SNAPSHOT",  "V5_8_4",
+
+                                                 "V5_8_5_SNAPSHOT",  "V5_8_5",
+
+                                                 "V5_8_6_SNAPSHOT",  "V5_8_6",
+
+                                                 "V5_8_7_SNAPSHOT",  "V5_8_7",
+
+                                                 "V5_8_8_SNAPSHOT",  "V5_8_8",
+
+                                                 "V5_8_9_SNAPSHOT",  "V5_8_9",
+
+                                                 "V5_9_0_SNAPSHOT",  "V5_9_0",
+
+                                                 "V5_9_1_SNAPSHOT",  "V5_9_1",
+
+                                                 "V5_9_2_SNAPSHOT",  "V5_9_2",
+
+                                                 "V5_9_3_SNAPSHOT",  "V5_9_3",
+
+                                                 "V5_9_4_SNAPSHOT",  "V5_9_4",
+
+                                                 "V5_9_5_SNAPSHOT",  "V5_9_5",
+
+                                                 "V5_9_6_SNAPSHOT",  "V5_9_6",
+
+                                                 "V5_9_7_SNAPSHOT",  "V5_9_7",
+
+                                                 "V5_9_8_SNAPSHOT",  "V5_9_8",
+
+                                                 "V5_9_9_SNAPSHOT",  "V5_9_9",
+                                                 "HIGHER_VERSION"
+
+};
 class MQVersion {
  public:
   enum Version {
@@ -216,14 +814,722 @@ class MQVersion {
 
     V3_5_9_SNAPSHOT,
     V3_5_9,
-  };
 
-  static const char* getVersionDesc(int value);
+    V3_6_1_SNAPSHOT,
+    V3_6_1,
 
- public:
+    V3_6_2_SNAPSHOT,
+    V3_6_2,
+
+    V3_6_3_SNAPSHOT,
+    V3_6_3,
+
+    V3_6_4_SNAPSHOT,
+    V3_6_4,
+
+    V3_6_5_SNAPSHOT,
+    V3_6_5,
+
+    V3_6_6_SNAPSHOT,
+    V3_6_6,
+
+    V3_6_7_SNAPSHOT,
+    V3_6_7,
+
+    V3_6_8_SNAPSHOT,
+    V3_6_8,
+
+    V3_6_9_SNAPSHOT,
+    V3_6_9,
+
+    V3_7_1_SNAPSHOT,
+    V3_7_1,
+
+    V3_7_2_SNAPSHOT,
+    V3_7_2,
+
+    V3_7_3_SNAPSHOT,
+    V3_7_3,
+
+    V3_7_4_SNAPSHOT,
+    V3_7_4,
+
+    V3_7_5_SNAPSHOT,
+    V3_7_5,
+
+    V3_7_6_SNAPSHOT,
+    V3_7_6,
+
+    V3_7_7_SNAPSHOT,
+    V3_7_7,
+
+    V3_7_8_SNAPSHOT,
+    V3_7_8,
+
+    V3_7_9_SNAPSHOT,
+    V3_7_9,
+
+    V3_8_1_SNAPSHOT,
+    V3_8_1,
+
+    V3_8_2_SNAPSHOT,
+    V3_8_2,
+
+    V3_8_3_SNAPSHOT,
+    V3_8_3,
+
+    V3_8_4_SNAPSHOT,
+    V3_8_4,
+
+    V3_8_5_SNAPSHOT,
+    V3_8_5,
+
+    V3_8_6_SNAPSHOT,
+    V3_8_6,
+
+    V3_8_7_SNAPSHOT,
+    V3_8_7,
+
+    V3_8_8_SNAPSHOT,
+    V3_8_8,
+
+    V3_8_9_SNAPSHOT,
+    V3_8_9,
+
+    V3_9_1_SNAPSHOT,
+    V3_9_1,
+
+    V3_9_2_SNAPSHOT,
+    V3_9_2,
+
+    V3_9_3_SNAPSHOT,
+    V3_9_3,
+
+    V3_9_4_SNAPSHOT,
+    V3_9_4,
+
+    V3_9_5_SNAPSHOT,
+    V3_9_5,
+
+    V3_9_6_SNAPSHOT,
+    V3_9_6,
+
+    V3_9_7_SNAPSHOT,
+    V3_9_7,
+
+    V3_9_8_SNAPSHOT,
+    V3_9_8,
+
+    V3_9_9_SNAPSHOT,
+    V3_9_9,
+
+    V4_0_0_SNAPSHOT,
+    V4_0_0,
+
+    V4_0_1_SNAPSHOT,
+    V4_0_1,
+
+    V4_0_2_SNAPSHOT,
+    V4_0_2,
+
+    V4_0_3_SNAPSHOT,
+    V4_0_3,
+
+    V4_0_4_SNAPSHOT,
+    V4_0_4,
+
+    V4_0_5_SNAPSHOT,
+    V4_0_5,
+
+    V4_0_6_SNAPSHOT,
+    V4_0_6,
+
+    V4_0_7_SNAPSHOT,
+    V4_0_7,
+
+    V4_0_8_SNAPSHOT,
+    V4_0_8,
+
+    V4_0_9_SNAPSHOT,
+    V4_0_9,
+
+    V4_1_0_SNAPSHOT,
+    V4_1_0,
+
+    V4_1_1_SNAPSHOT,
+    V4_1_1,
+
+    V4_1_2_SNAPSHOT,
+    V4_1_2,
+
+    V4_1_3_SNAPSHOT,
+    V4_1_3,
+
+    V4_1_4_SNAPSHOT,
+    V4_1_4,
+
+    V4_1_5_SNAPSHOT,
+    V4_1_5,
+
+    V4_1_6_SNAPSHOT,
+    V4_1_6,
+
+    V4_1_7_SNAPSHOT,
+    V4_1_7,
+
+    V4_1_8_SNAPSHOT,
+    V4_1_8,
+
+    V4_1_9_SNAPSHOT,
+    V4_1_9,
+
+    V4_2_0_SNAPSHOT,
+    V4_2_0,
+
+    V4_2_1_SNAPSHOT,
+    V4_2_1,
+
+    V4_2_2_SNAPSHOT,
+    V4_2_2,
+
+    V4_2_3_SNAPSHOT,
+    V4_2_3,
+
+    V4_2_4_SNAPSHOT,
+    V4_2_4,
+
+    V4_2_5_SNAPSHOT,
+    V4_2_5,
+
+    V4_2_6_SNAPSHOT,
+    V4_2_6,
+
+    V4_2_7_SNAPSHOT,
+    V4_2_7,
+
+    V4_2_8_SNAPSHOT,
+    V4_2_8,
+
+    V4_2_9_SNAPSHOT,
+    V4_2_9,
+
+    V4_3_0_SNAPSHOT,
+    V4_3_0,
+
+    V4_3_1_SNAPSHOT,
+    V4_3_1,
+
+    V4_3_2_SNAPSHOT,
+    V4_3_2,
+
+    V4_3_3_SNAPSHOT,
+    V4_3_3,
+
+    V4_3_4_SNAPSHOT,
+    V4_3_4,
+
+    V4_3_5_SNAPSHOT,
+    V4_3_5,
+
+    V4_3_6_SNAPSHOT,
+    V4_3_6,
+
+    V4_3_7_SNAPSHOT,
+    V4_3_7,
+
+    V4_3_8_SNAPSHOT,
+    V4_3_8,
+
+    V4_3_9_SNAPSHOT,
+    V4_3_9,
+
+    V4_4_0_SNAPSHOT,
+    V4_4_0,
+
+    V4_4_1_SNAPSHOT,
+    V4_4_1,
+
+    V4_4_2_SNAPSHOT,
+    V4_4_2,
+
+    V4_4_3_SNAPSHOT,
+    V4_4_3,
+
+    V4_4_4_SNAPSHOT,
+    V4_4_4,
+
+    V4_4_5_SNAPSHOT,
+    V4_4_5,
+
+    V4_4_6_SNAPSHOT,
+    V4_4_6,
+
+    V4_4_7_SNAPSHOT,
+    V4_4_7,
+
+    V4_4_8_SNAPSHOT,
+    V4_4_8,
+
+    V4_4_9_SNAPSHOT,
+    V4_4_9,
+
+    V4_5_0_SNAPSHOT,
+    V4_5_0,
+
+    V4_5_1_SNAPSHOT,
+    V4_5_1,
+
+    V4_5_2_SNAPSHOT,
+    V4_5_2,
+
+    V4_5_3_SNAPSHOT,
+    V4_5_3,
+
+    V4_5_4_SNAPSHOT,
+    V4_5_4,
+
+    V4_5_5_SNAPSHOT,
+    V4_5_5,
+
+    V4_5_6_SNAPSHOT,
+    V4_5_6,
+
+    V4_5_7_SNAPSHOT,
+    V4_5_7,
+
+    V4_5_8_SNAPSHOT,
+    V4_5_8,
+
+    V4_5_9_SNAPSHOT,
+    V4_5_9,
+
+    V4_6_0_SNAPSHOT,
+    V4_6_0,
+
+    V4_6_1_SNAPSHOT,
+    V4_6_1,
+
+    V4_6_2_SNAPSHOT,
+    V4_6_2,
+
+    V4_6_3_SNAPSHOT,
+    V4_6_3,
+
+    V4_6_4_SNAPSHOT,
+    V4_6_4,
+
+    V4_6_5_SNAPSHOT,
+    V4_6_5,
+
+    V4_6_6_SNAPSHOT,
+    V4_6_6,
+
+    V4_6_7_SNAPSHOT,
+    V4_6_7,
+
+    V4_6_8_SNAPSHOT,
+    V4_6_8,
+
+    V4_6_9_SNAPSHOT,
+    V4_6_9,
+
+    V4_7_0_SNAPSHOT,
+    V4_7_0,
+
+    V4_7_1_SNAPSHOT,
+    V4_7_1,
+
+    V4_7_2_SNAPSHOT,
+    V4_7_2,
+
+    V4_7_3_SNAPSHOT,
+    V4_7_3,
+
+    V4_7_4_SNAPSHOT,
+    V4_7_4,
+
+    V4_7_5_SNAPSHOT,
+    V4_7_5,
+
+    V4_7_6_SNAPSHOT,
+    V4_7_6,
+
+    V4_7_7_SNAPSHOT,
+    V4_7_7,
+
+    V4_7_8_SNAPSHOT,
+    V4_7_8,
+
+    V4_7_9_SNAPSHOT,
+    V4_7_9,
+
+    V4_8_0_SNAPSHOT,
+    V4_8_0,
+
+    V4_8_1_SNAPSHOT,
+    V4_8_1,
+
+    V4_8_2_SNAPSHOT,
+    V4_8_2,
+
+    V4_8_3_SNAPSHOT,
+    V4_8_3,
+
+    V4_8_4_SNAPSHOT,
+    V4_8_4,
+
+    V4_8_5_SNAPSHOT,
+    V4_8_5,
+
+    V4_8_6_SNAPSHOT,
+    V4_8_6,
+
+    V4_8_7_SNAPSHOT,
+    V4_8_7,
+
+    V4_8_8_SNAPSHOT,
+    V4_8_8,
+
+    V4_8_9_SNAPSHOT,
+    V4_8_9,
+
+    V4_9_0_SNAPSHOT,
+    V4_9_0,
+
+    V4_9_1_SNAPSHOT,
+    V4_9_1,
+
+    V4_9_2_SNAPSHOT,
+    V4_9_2,
+
+    V4_9_3_SNAPSHOT,
+    V4_9_3,
+
+    V4_9_4_SNAPSHOT,
+    V4_9_4,
+
+    V4_9_5_SNAPSHOT,
+    V4_9_5,
+
+    V4_9_6_SNAPSHOT,
+    V4_9_6,
+
+    V4_9_7_SNAPSHOT,
+    V4_9_7,
+
+    V4_9_8_SNAPSHOT,
+    V4_9_8,
+
+    V4_9_9_SNAPSHOT,
+    V4_9_9,
+
+    V5_0_0_SNAPSHOT,
+    V5_0_0,
+
+    V5_0_1_SNAPSHOT,
+    V5_0_1,
+
+    V5_0_2_SNAPSHOT,
+    V5_0_2,
+
+    V5_0_3_SNAPSHOT,
+    V5_0_3,
+
+    V5_0_4_SNAPSHOT,
+    V5_0_4,
+
+    V5_0_5_SNAPSHOT,
+    V5_0_5,
+
+    V5_0_6_SNAPSHOT,
+    V5_0_6,
+
+    V5_0_7_SNAPSHOT,
+    V5_0_7,
+
+    V5_0_8_SNAPSHOT,
+    V5_0_8,
+
+    V5_0_9_SNAPSHOT,
+    V5_0_9,
+
+    V5_1_0_SNAPSHOT,
+    V5_1_0,
+
+    V5_1_1_SNAPSHOT,
+    V5_1_1,
+
+    V5_1_2_SNAPSHOT,
+    V5_1_2,
+
+    V5_1_3_SNAPSHOT,
+    V5_1_3,
+
+    V5_1_4_SNAPSHOT,
+    V5_1_4,
+
+    V5_1_5_SNAPSHOT,
+    V5_1_5,
+
+    V5_1_6_SNAPSHOT,
+    V5_1_6,
+
+    V5_1_7_SNAPSHOT,
+    V5_1_7,
+
+    V5_1_8_SNAPSHOT,
+    V5_1_8,
+
+    V5_1_9_SNAPSHOT,
+    V5_1_9,
+
+    V5_2_0_SNAPSHOT,
+    V5_2_0,
+
+    V5_2_1_SNAPSHOT,
+    V5_2_1,
+
+    V5_2_2_SNAPSHOT,
+    V5_2_2,
+
+    V5_2_3_SNAPSHOT,
+    V5_2_3,
+
+    V5_2_4_SNAPSHOT,
+    V5_2_4,
+
+    V5_2_5_SNAPSHOT,
+    V5_2_5,
+
+    V5_2_6_SNAPSHOT,
+    V5_2_6,
+
+    V5_2_7_SNAPSHOT,
+    V5_2_7,
+
+    V5_2_8_SNAPSHOT,
+    V5_2_8,
+
+    V5_2_9_SNAPSHOT,
+    V5_2_9,
+
+    V5_3_0_SNAPSHOT,
+    V5_3_0,
+
+    V5_3_1_SNAPSHOT,
+    V5_3_1,
+
+    V5_3_2_SNAPSHOT,
+    V5_3_2,
+
+    V5_3_3_SNAPSHOT,
+    V5_3_3,
+
+    V5_3_4_SNAPSHOT,
+    V5_3_4,
+
+    V5_3_5_SNAPSHOT,
+    V5_3_5,
+
+    V5_3_6_SNAPSHOT,
+    V5_3_6,
+
+    V5_3_7_SNAPSHOT,
+    V5_3_7,
+
+    V5_3_8_SNAPSHOT,
+    V5_3_8,
+
+    V5_3_9_SNAPSHOT,
+    V5_3_9,
+
+    V5_4_0_SNAPSHOT,
+    V5_4_0,
+
+    V5_4_1_SNAPSHOT,
+    V5_4_1,
+
+    V5_4_2_SNAPSHOT,
+    V5_4_2,
+
+    V5_4_3_SNAPSHOT,
+    V5_4_3,
+
+    V5_4_4_SNAPSHOT,
+    V5_4_4,
+
+    V5_4_5_SNAPSHOT,
+    V5_4_5,
+
+    V5_4_6_SNAPSHOT,
+    V5_4_6,
+
+    V5_4_7_SNAPSHOT,
+    V5_4_7,
+
+    V5_4_8_SNAPSHOT,
+    V5_4_8,
+
+    V5_4_9_SNAPSHOT,
+    V5_4_9,
+
+    V5_5_0_SNAPSHOT,
+    V5_5_0,
+
+    V5_5_1_SNAPSHOT,
+    V5_5_1,
+
+    V5_5_2_SNAPSHOT,
+    V5_5_2,
+
+    V5_5_3_SNAPSHOT,
+    V5_5_3,
+
+    V5_5_4_SNAPSHOT,
+    V5_5_4,
+
+    V5_5_5_SNAPSHOT,
+    V5_5_5,
+
+    V5_5_6_SNAPSHOT,
+    V5_5_6,
+
+    V5_5_7_SNAPSHOT,
+    V5_5_7,
+
+    V5_5_8_SNAPSHOT,
+    V5_5_8,
+
+    V5_5_9_SNAPSHOT,
+    V5_5_9,
+
+    V5_6_0_SNAPSHOT,
+    V5_6_0,
+
+    V5_6_1_SNAPSHOT,
+    V5_6_1,
+
+    V5_6_2_SNAPSHOT,
+    V5_6_2,
+
+    V5_6_3_SNAPSHOT,
+    V5_6_3,
+
+    V5_6_4_SNAPSHOT,
+    V5_6_4,
+
+    V5_6_5_SNAPSHOT,
+    V5_6_5,
+
+    V5_6_6_SNAPSHOT,
+    V5_6_6,
+
+    V5_6_7_SNAPSHOT,
+    V5_6_7,
+
+    V5_6_8_SNAPSHOT,
+    V5_6_8,
+
+    V5_6_9_SNAPSHOT,
+    V5_6_9,
+
+    V5_7_0_SNAPSHOT,
+    V5_7_0,
+
+    V5_7_1_SNAPSHOT,
+    V5_7_1,
+
+    V5_7_2_SNAPSHOT,
+    V5_7_2,
+
+    V5_7_3_SNAPSHOT,
+    V5_7_3,
+
+    V5_7_4_SNAPSHOT,
+    V5_7_4,
+
+    V5_7_5_SNAPSHOT,
+    V5_7_5,
+
+    V5_7_6_SNAPSHOT,
+    V5_7_6,
+
+    V5_7_7_SNAPSHOT,
+    V5_7_7,
+
+    V5_7_8_SNAPSHOT,
+    V5_7_8,
+
+    V5_7_9_SNAPSHOT,
+    V5_7_9,
+
+    V5_8_0_SNAPSHOT,
+    V5_8_0,
+
+    V5_8_1_SNAPSHOT,
+    V5_8_1,
+
+    V5_8_2_SNAPSHOT,
+    V5_8_2,
+
+    V5_8_3_SNAPSHOT,
+    V5_8_3,
+
+    V5_8_4_SNAPSHOT,
+    V5_8_4,
+
+    V5_8_5_SNAPSHOT,
+    V5_8_5,
+
+    V5_8_6_SNAPSHOT,
+    V5_8_6,
+
+    V5_8_7_SNAPSHOT,
+    V5_8_7,
+
+    V5_8_8_SNAPSHOT,
+    V5_8_8,
+
+    V5_8_9_SNAPSHOT,
+    V5_8_9,
+
+    V5_9_0_SNAPSHOT,
+    V5_9_0,
+
+    V5_9_1_SNAPSHOT,
+    V5_9_1,
+
+    V5_9_2_SNAPSHOT,
+    V5_9_2,
+
+    V5_9_3_SNAPSHOT,
+    V5_9_3,
+
+    V5_9_4_SNAPSHOT,
+    V5_9_4,
+
+    V5_9_5_SNAPSHOT,
+    V5_9_5,
+
+    V5_9_6_SNAPSHOT,
+    V5_9_6,
+
+    V5_9_7_SNAPSHOT,
+    V5_9_7,
+
+    V5_9_8_SNAPSHOT,
+    V5_9_8,
+
+    V5_9_9_SNAPSHOT,
+    V5_9_9,
+    HIGHER_VERSION
+  };
+
+  static const char* GetVersionDesc(int value);
   static int s_CurrentVersion;
+  static std::string s_CurrentLanguage;
 };
 
 //<!***************************************************************************
-}  //<!end namespace;
+}  // namespace rocketmq
 #endif
diff --git a/src/common/VirtualEnvUtil.cpp b/src/common/VirtualEnvUtil.cpp
index 15517e9..4b6eb40 100644
--- a/src/common/VirtualEnvUtil.cpp
+++ b/src/common/VirtualEnvUtil.cpp
@@ -28,7 +28,7 @@ string VirtualEnvUtil::buildWithProjectGroup(const string& origin, const string&
     char prefix[1024];
     sprintf(prefix, VIRTUAL_APPGROUP_PREFIX, projectGroup.c_str());
 
-    if (origin.find_last_of(prefix) == string::npos) {
+    if (origin.find(prefix) == string::npos) {
       return origin + prefix;
     } else {
       return origin;
@@ -41,7 +41,7 @@ string VirtualEnvUtil::buildWithProjectGroup(const string& origin, const string&
 string VirtualEnvUtil::clearProjectGroup(const string& origin, const string& projectGroup) {
   char prefix[1024];
   sprintf(prefix, VIRTUAL_APPGROUP_PREFIX, projectGroup.c_str());
-  string::size_type pos = origin.find_last_of(prefix);
+  auto pos = origin.find(prefix);
 
   if (!UtilAll::isBlank(prefix) && pos != string::npos) {
     return origin.substr(0, pos);
@@ -51,4 +51,4 @@ string VirtualEnvUtil::clearProjectGroup(const string& origin, const string& pro
 }
 
 //<!***************************************************************************
-}  //<!end namespace;
+}  // namespace rocketmq
diff --git a/src/producer/DefaultMQProducer.cpp b/src/producer/DefaultMQProducer.cpp
index bd9cbc0..ee81a7b 100644
--- a/src/producer/DefaultMQProducer.cpp
+++ b/src/producer/DefaultMQProducer.cpp
@@ -449,6 +449,7 @@ SendResult DefaultMQProducer::sendKernelImpl(MQMessage& msg,
       requestHeader->sysFlag = (msg.getSysFlag());
       requestHeader->bornTimestamp = UtilAll::currentTimeMillis();
       requestHeader->flag = (msg.getFlag());
+      requestHeader->consumeRetryTimes = 16;
       requestHeader->batch = isBatchMsg;
       requestHeader->properties = (MQDecoder::messageProperties2String(msg.getProperties()));
 
diff --git a/src/protocol/CommandHeader.cpp b/src/protocol/CommandHeader.cpp
index 46d3cbf..1360d04 100644
--- a/src/protocol/CommandHeader.cpp
+++ b/src/protocol/CommandHeader.cpp
@@ -160,14 +160,6 @@ void SendMessageRequestHeader::Encode(Json::Value& outData) {
   outData["batch"] = UtilAll::to_string(batch);
 }
 
-int SendMessageRequestHeader::getReconsumeTimes() {
-  return reconsumeTimes;
-}
-
-void SendMessageRequestHeader::setReconsumeTimes(int input_reconsumeTimes) {
-  reconsumeTimes = input_reconsumeTimes;
-}
-
 void SendMessageRequestHeader::SetDeclaredFieldOfCommandHeader(map<string, string>& requestMap) {
   LOG_DEBUG(
       "SendMessageRequestHeader producerGroup is:%s,topic is:%s, defaulttopic "
@@ -194,6 +186,64 @@ void SendMessageRequestHeader::SetDeclaredFieldOfCommandHeader(map<string, strin
 }
 
 //<!************************************************************************
+void SendMessageRequestHeaderV2::Encode(Json::Value& outData) {
+  outData["a"] = a;                      // string producerGroup;
+  outData["b"] = b;                      // string topic;
+  outData["c"] = c;                      // string defaultTopic;
+  outData["d"] = d;                      // int defaultTopicQueueNums;
+  outData["e"] = e;                      // int queueId;
+  outData["f"] = f;                      // int sysFlag;
+  outData["g"] = UtilAll::to_string(g);  // int64 bornTimestamp;
+  outData["h"] = h;                      // int flag;
+  outData["i"] = i;                      // string properties;
+  outData["j"] = UtilAll::to_string(j);  // int reconsumeTimes;
+  outData["k"] = UtilAll::to_string(k);  // bool unitMode;
+  outData["l"] = l;                      // int consumeRetryTimes;
+  outData["m"] = UtilAll::to_string(m);  // bool batch;
+}
+
+void SendMessageRequestHeaderV2::SetDeclaredFieldOfCommandHeader(map<string, string>& requestMap) {
+  LOG_DEBUG(
+      "SendMessageRequestHeaderV2 producerGroup is:%s,topic is:%s, defaulttopic "
+      "is:%s, properties is:%s,UtilAll::to_string( defaultTopicQueueNums) "
+      "is:%s,UtilAll::to_string( queueId):%s, UtilAll::to_string( sysFlag) "
+      "is:%s, UtilAll::to_string( bornTimestamp) is:%s,UtilAll::to_string( "
+      "flag) is:%s,UtilAll::to_string( reconsumeTimes) is:%s,UtilAll::to_string( unitMode) is:%s,UtilAll::to_string( "
+      "batch) is:%s",
+      a.c_str(), b.c_str(), c.c_str(), i.c_str(), UtilAll::to_string(d).c_str(), UtilAll::to_string(e).c_str(),
+      UtilAll::to_string(f).c_str(), UtilAll::to_string(g).c_str(), UtilAll::to_string(g).c_str(),
+      UtilAll::to_string(j).c_str(), UtilAll::to_string(k).c_str(), UtilAll::to_string(m).c_str());
+
+  requestMap.insert(pair<string, string>("a", a));
+  requestMap.insert(pair<string, string>("b", b));
+  requestMap.insert(pair<string, string>("c", c));
+  requestMap.insert(pair<string, string>("d", UtilAll::to_string(d)));
+  requestMap.insert(pair<string, string>("e", UtilAll::to_string(e)));
+  requestMap.insert(pair<string, string>("f", UtilAll::to_string(f)));
+  requestMap.insert(pair<string, string>("g", UtilAll::to_string(g)));
+  requestMap.insert(pair<string, string>("h", UtilAll::to_string(h)));
+  requestMap.insert(pair<string, string>("i", i));
+  requestMap.insert(pair<string, string>("j", UtilAll::to_string(j)));
+  requestMap.insert(pair<string, string>("k", UtilAll::to_string(k)));
+  requestMap.insert(pair<string, string>("l", UtilAll::to_string(l)));
+  requestMap.insert(pair<string, string>("m", UtilAll::to_string(m)));
+}
+void SendMessageRequestHeaderV2::CreateSendMessageRequestHeaderV1(SendMessageRequestHeader& v1) {
+  v1.producerGroup = a;
+  v1.topic = b;
+  v1.defaultTopic = c;
+  v1.defaultTopicQueueNums = d;
+  v1.queueId = e;
+  v1.sysFlag = f;
+  v1.bornTimestamp = g;
+  v1.flag = h;
+  v1.properties = i;
+  v1.reconsumeTimes = j;
+  v1.unitMode = k;
+  v1.consumeRetryTimes = l;
+  v1.batch = m;
+}
+//<!************************************************************************
 CommandHeader* SendMessageResponseHeader::Decode(Json::Value& ext) {
   SendMessageResponseHeader* h = new SendMessageResponseHeader();
 
diff --git a/src/protocol/CommandHeader.h b/src/protocol/CommandHeader.h
index 4a80ecf..cedaeb9 100644
--- a/src/protocol/CommandHeader.h
+++ b/src/protocol/CommandHeader.h
@@ -150,12 +150,11 @@ class SendMessageRequestHeader : public CommandHeader {
         flag(0),
         reconsumeTimes(0),
         unitMode(false),
+        consumeRetryTimes(0),
         batch(false) {}
   virtual ~SendMessageRequestHeader() {}
   virtual void Encode(Json::Value& outData);
   virtual void SetDeclaredFieldOfCommandHeader(map<string, string>& requestMap);
-  int getReconsumeTimes();
-  void setReconsumeTimes(int input_reconsumeTimes);
 
  public:
   string producerGroup;
@@ -169,10 +168,51 @@ class SendMessageRequestHeader : public CommandHeader {
   string properties;
   int reconsumeTimes;
   bool unitMode;
+  int consumeRetryTimes;
   bool batch;
 };
 
 //<!************************************************************************
+class SendMessageRequestHeaderV2 : public CommandHeader {
+ public:
+  SendMessageRequestHeaderV2(SendMessageRequestHeader v1) {
+    a = v1.producerGroup;
+    b = v1.topic;
+    c = v1.defaultTopic;
+    d = v1.defaultTopicQueueNums;
+    e = v1.queueId;
+    f = v1.sysFlag;
+    g = v1.bornTimestamp;
+    h = v1.flag;
+    i = v1.properties;
+    j = v1.reconsumeTimes;
+    k = v1.unitMode;
+    l = v1.consumeRetryTimes;
+    m = v1.batch;
+  }
+  SendMessageRequestHeaderV2() : d(0), e(0), f(0), g(0), h(0), j(0), k(false), l(16), m(false) {}
+  virtual ~SendMessageRequestHeaderV2() {}
+  virtual void Encode(Json::Value& outData);
+  virtual void SetDeclaredFieldOfCommandHeader(map<string, string>& requestMap);
+  virtual void CreateSendMessageRequestHeaderV1(SendMessageRequestHeader& v1);
+
+ public:
+  string a;  // producerGroup
+  string b;  // topic;
+  string c;  // defaultTopic;
+  int d;     // defaultTopicQueueNums;
+  int e;     // queueId;
+  int f;     // sysFlag;
+  int64 g;   // bornTimestamp;
+  int h;     // flag;
+  string i;  // properties;
+  int j;     // reconsumeTimes;
+  bool k;    // unitMode;
+  int l;     // consumeRetryTimes;
+  bool m;    // batch;
+};
+
+//<!************************************************************************
 class SendMessageResponseHeader : public CommandHeader {
  public:
   SendMessageResponseHeader() : queueId(0), queueOffset(0) { msgId.clear(); }
diff --git a/src/protocol/RemotingCommand.cpp b/src/protocol/RemotingCommand.cpp
index 08765de..cb7bd1d 100644
--- a/src/protocol/RemotingCommand.cpp
+++ b/src/protocol/RemotingCommand.cpp
@@ -27,7 +27,7 @@ boost::atomic<int> RemotingCommand::s_seqNumber;
 //<!************************************************************************
 RemotingCommand::RemotingCommand(int code, CommandHeader* pExtHeader /* = NULL */)
     : m_code(code),
-      m_language("CPP"),
+      m_language(MQVersion::s_CurrentLanguage),
       m_version(MQVersion::s_CurrentVersion),
       m_flag(0),
       m_remark(""),
@@ -88,7 +88,7 @@ void RemotingCommand::Assign(const RemotingCommand& command) {
 void RemotingCommand::Encode() {
   Json::Value root;
   root["code"] = m_code;
-  root["language"] = "CPP";
+  root["language"] = m_language;
   root["version"] = m_version;
   root["opaque"] = m_opaque;
   root["flag"] = m_flag;
@@ -172,7 +172,7 @@ RemotingCommand* RemotingCommand::Decode(const MemoryBlock& mem) {
     remark = object["remark"].asString();
   }
   LOG_DEBUG(
-      "code:%d, remark:%s, version:%d, opaque:%d, flag:%d, remark:%s, "
+      "code:%d, language:%s, version:%d, opaque:%d, flag:%d, remark:%s, "
       "headLen:%d, bodyLen:%d ",
       code, language.c_str(), version, opaque, flag, remark.c_str(), headLen, bodyLen);
   RemotingCommand* cmd = new RemotingCommand(code, language, version, opaque, flag, remark, NULL);
@@ -214,6 +214,7 @@ void RemotingCommand::SetExtHeader(int code) {
       m_pExtHeader = NULL;
       switch (code) {
         case SEND_MESSAGE:
+        case SEND_MESSAGE_V2:
           m_pExtHeader.reset(SendMessageResponseHeader::Decode(ext));
           break;
         case PULL_MESSAGE:
@@ -310,4 +311,4 @@ std::string RemotingCommand::ToString() const {
   return ss.str();
 }
 
-}  //<!end namespace;
+}  // namespace rocketmq
diff --git a/test/src/common/VirtualEnvUtilTest.cpp b/test/src/common/MQVersionTest.cpp
similarity index 62%
copy from test/src/common/VirtualEnvUtilTest.cpp
copy to test/src/common/MQVersionTest.cpp
index f02889c..587339b 100644
--- a/test/src/common/VirtualEnvUtilTest.cpp
+++ b/test/src/common/MQVersionTest.cpp
@@ -14,38 +14,32 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "string.h"
-
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-#include "VirtualEnvUtil.h"
-
-using std::string;
+#include "MQVersion.h"
 
 using ::testing::InitGoogleMock;
 using ::testing::InitGoogleTest;
 using testing::Return;
 
-using rocketmq::VirtualEnvUtil;
-
-VirtualEnvUtil virtualEnvUtil;
-
-TEST(virtualEnvUtil, buildWithProjectGroup) {
-  string origin = "origin";
-  string projectGroup;
-  EXPECT_EQ(virtualEnvUtil.buildWithProjectGroup(origin, string()), origin);
-
-  EXPECT_EQ(virtualEnvUtil.buildWithProjectGroup(origin, string("123")), origin);
+using rocketmq::MQVersion;
+using rocketmq::RocketMQCPPClientVersion;
+
+TEST(MQVersionTest, Version2String) {
+  for (int v = MQVersion::V3_0_0_SNAPSHOT; v <= MQVersion::HIGHER_VERSION; v++) {
+    EXPECT_STREQ(MQVersion::GetVersionDesc(v), RocketMQCPPClientVersion[v]);
+  }
+  EXPECT_STREQ(MQVersion::GetVersionDesc(-100), MQVersion::GetVersionDesc(MQVersion::V3_0_0_SNAPSHOT));
+  EXPECT_STREQ(MQVersion::GetVersionDesc(MQVersion::V4_6_0), "V4_6_0");
+  EXPECT_STREQ(MQVersion::GetVersionDesc(MQVersion::HIGHER_VERSION + 100),
+               MQVersion::GetVersionDesc(MQVersion::HIGHER_VERSION));
 }
 
-TEST(virtualEnvUtil, clearProjectGroup) {}
-
 int main(int argc, char* argv[]) {
   InitGoogleMock(&argc, argv);
-
   testing::GTEST_FLAG(throw_on_failure) = true;
-  testing::GTEST_FLAG(filter) = "messageExt.init";
+  testing::GTEST_FLAG(filter) = "MQVersionTest.*";
   int itestts = RUN_ALL_TESTS();
   return itestts;
 }
diff --git a/test/src/common/VirtualEnvUtilTest.cpp b/test/src/common/VirtualEnvUtilTest.cpp
index f02889c..1300c90 100644
--- a/test/src/common/VirtualEnvUtilTest.cpp
+++ b/test/src/common/VirtualEnvUtilTest.cpp
@@ -29,23 +29,36 @@ using testing::Return;
 
 using rocketmq::VirtualEnvUtil;
 
-VirtualEnvUtil virtualEnvUtil;
-
 TEST(virtualEnvUtil, buildWithProjectGroup) {
   string origin = "origin";
-  string projectGroup;
-  EXPECT_EQ(virtualEnvUtil.buildWithProjectGroup(origin, string()), origin);
-
-  EXPECT_EQ(virtualEnvUtil.buildWithProjectGroup(origin, string("123")), origin);
+  string originWithGroupA = "origin%PROJECT_testGroupA%";
+  string originWithGroupB = "origin%PROJECT_testGroupB%";
+  string originWithGroupAB = "origin%PROJECT_testGroupA%%PROJECT_testGroupB%";
+  string projectGroupA = "testGroupA";
+  string projectGroupB = "testGroupB";
+  EXPECT_EQ(VirtualEnvUtil::buildWithProjectGroup(origin, string()), origin);
+  EXPECT_EQ(VirtualEnvUtil::buildWithProjectGroup(origin, projectGroupA), originWithGroupA);
+  EXPECT_EQ(VirtualEnvUtil::buildWithProjectGroup(originWithGroupA, projectGroupA), originWithGroupA);
+  EXPECT_EQ(VirtualEnvUtil::buildWithProjectGroup(originWithGroupA, projectGroupB), originWithGroupAB);
 }
 
-TEST(virtualEnvUtil, clearProjectGroup) {}
+TEST(virtualEnvUtil, clearProjectGroup) {
+  string origin = "origin";
+  string originWithGroup = "origin%PROJECT_testGroup%";
+  string projectGroup = "testGroup";
+  string projectGroupB = "testGroupB";
+  EXPECT_EQ(VirtualEnvUtil::clearProjectGroup(origin, string()), origin);
+  EXPECT_EQ(VirtualEnvUtil::clearProjectGroup(originWithGroup, string()), originWithGroup);
+  EXPECT_EQ(VirtualEnvUtil::clearProjectGroup(originWithGroup, projectGroupB), originWithGroup);
+  EXPECT_EQ(VirtualEnvUtil::clearProjectGroup(origin, projectGroup), origin);
+  EXPECT_EQ(VirtualEnvUtil::clearProjectGroup(originWithGroup, projectGroup), origin);
+}
 
 int main(int argc, char* argv[]) {
   InitGoogleMock(&argc, argv);
 
   testing::GTEST_FLAG(throw_on_failure) = true;
-  testing::GTEST_FLAG(filter) = "messageExt.init";
-  int itestts = RUN_ALL_TESTS();
-  return itestts;
+  testing::GTEST_FLAG(filter) = "virtualEnvUtil.*";
+  int iTest = RUN_ALL_TESTS();
+  return iTest;
 }
diff --git a/test/src/protocol/CommandHeaderTest.cpp b/test/src/protocol/CommandHeaderTest.cpp
index 5d46974..ccfa5ba 100644
--- a/test/src/protocol/CommandHeaderTest.cpp
+++ b/test/src/protocol/CommandHeaderTest.cpp
@@ -61,6 +61,7 @@ using rocketmq::ResetOffsetRequestHeader;
 using rocketmq::SearchOffsetRequestHeader;
 using rocketmq::SearchOffsetResponseHeader;
 using rocketmq::SendMessageRequestHeader;
+using rocketmq::SendMessageRequestHeaderV2;
 using rocketmq::SendMessageResponseHeader;
 using rocketmq::UnregisterClientRequestHeader;
 using rocketmq::UpdateConsumerOffsetRequestHeader;
@@ -201,8 +202,6 @@ TEST(commandHeader, SendMessageRequestHeader) {
   header.reconsumeTimes = reconsumeTimes;
   header.unitMode = unitMode;
   header.batch = batch;
-  header.setReconsumeTimes(reconsumeTimes);
-  EXPECT_EQ(header.getReconsumeTimes(), reconsumeTimes);
   map<string, string> requestMap;
   header.SetDeclaredFieldOfCommandHeader(requestMap);
   EXPECT_EQ(requestMap["topic"], topic);
@@ -234,6 +233,76 @@ TEST(commandHeader, SendMessageRequestHeader) {
   EXPECT_EQ(outData["batch"], "0");
 }
 
+TEST(commandHeader, SendMessageRequestHeaderV2) {
+  string producerGroup = "testProducer";
+  string topic = "testTopic";
+  string defaultTopic = "defaultTopic";
+  int defaultTopicQueueNums = 1;
+  int queueId = 2;
+  int sysFlag = 3;
+  int64 bornTimestamp = 4;
+  int flag = 5;
+  string properties = "testProperty";
+  int reconsumeTimes = 6;
+  bool unitMode = true;
+  bool batch = false;
+
+  SendMessageRequestHeaderV2 header;
+  header.a = producerGroup;
+  header.b = topic;
+  header.c = defaultTopic;
+  header.d = defaultTopicQueueNums;
+  header.e = queueId;
+  header.f = sysFlag;
+  header.g = bornTimestamp;
+  header.h = flag;
+  header.i = properties;
+  header.j = reconsumeTimes;
+  header.k = unitMode;
+  header.m = batch;
+  map<string, string> requestMap;
+  header.SetDeclaredFieldOfCommandHeader(requestMap);
+  EXPECT_EQ(requestMap["a"], producerGroup);
+  EXPECT_EQ(requestMap["b"], topic);
+  EXPECT_EQ(requestMap["c"], defaultTopic);
+  EXPECT_EQ(requestMap["d"], "1");
+  EXPECT_EQ(requestMap["e"], "2");
+  EXPECT_EQ(requestMap["f"], "3");
+  EXPECT_EQ(requestMap["g"], "4");
+  EXPECT_EQ(requestMap["h"], "5");
+  EXPECT_EQ(requestMap["i"], properties);
+  EXPECT_EQ(requestMap["j"], "6");
+  EXPECT_EQ(requestMap["k"], "1");
+  EXPECT_EQ(requestMap["m"], "0");
+
+  Value outData;
+  header.Encode(outData);
+  EXPECT_EQ(outData["a"], producerGroup);
+  EXPECT_EQ(outData["b"], topic);
+  EXPECT_EQ(outData["c"], defaultTopic);
+  EXPECT_EQ(outData["d"], defaultTopicQueueNums);
+  EXPECT_EQ(outData["e"], queueId);
+  EXPECT_EQ(outData["f"], sysFlag);
+  EXPECT_EQ(outData["g"], "4");
+  EXPECT_EQ(outData["h"], flag);
+  EXPECT_EQ(outData["i"], properties);
+  EXPECT_EQ(outData["j"], "6");
+  EXPECT_EQ(outData["k"], "1");
+  EXPECT_EQ(outData["m"], "0");
+
+  SendMessageRequestHeader v1;
+  header.CreateSendMessageRequestHeaderV1(v1);
+  EXPECT_EQ(v1.producerGroup, producerGroup);
+  EXPECT_EQ(v1.queueId, queueId);
+  EXPECT_EQ(v1.batch, batch);
+
+  SendMessageRequestHeaderV2 v2(v1);
+  EXPECT_EQ(header.a, v2.a);
+  EXPECT_EQ(header.e, v2.e);
+  EXPECT_EQ(header.m, v2.m);
+  EXPECT_EQ(header.g, v2.g);
+}
+
 TEST(commandHeader, SendMessageResponseHeader) {
   SendMessageResponseHeader header;
   header.msgId = "ABCDEFG";


Mime
View raw message