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/05/26 23:17:17 UTC

[rocketmq-client-cpp] branch re_dev updated (11bf396 -> 7eef639)

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

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


    from 11bf396  feat: support Request-Reply. (#299)
     new 8c6f24d  findConsumerIds from same broker more time
     new 7eef639  fixed uniqMsgId for batch result.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/MQClientAPIImpl.cpp  | 11 +++++------
 src/MQClientInstance.cpp |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)


[rocketmq-client-cpp] 02/02: fixed uniqMsgId for batch result.

Posted by if...@apache.org.
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 7eef63909442d1b522fce2170f9f10c746292199
Author: James Yin <yw...@hotmail.com>
AuthorDate: Mon May 18 11:23:35 2020 +0800

    fixed uniqMsgId for batch result.
---
 src/MQClientAPIImpl.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/MQClientAPIImpl.cpp b/src/MQClientAPIImpl.cpp
index 53da586..23fea6a 100644
--- a/src/MQClientAPIImpl.cpp
+++ b/src/MQClientAPIImpl.cpp
@@ -219,14 +219,13 @@ SendResult* MQClientAPIImpl::processSendResponse(const std::string& brokerName,
   if (msg->isBatch()) {
     const auto& messages = static_cast<const MessageBatch*>(msg)->getMessages();
     uniqMsgId.clear();
-    uniqMsgId.reserve(33 * messages.size());
-    bool isFirst = true;
+    uniqMsgId.reserve(33 * messages.size() + 1);
     for (const auto& message : messages) {
-      if (!isFirst) {
-        uniqMsgId.append(",");
-        isFirst = false;
-      }
       uniqMsgId.append(MessageClientIDSetter::getUniqID(*message));
+      uniqMsgId.append(",");
+    }
+    if (!uniqMsgId.empty()) {
+      uniqMsgId.resize(uniqMsgId.length() - 1);
     }
   }
 


[rocketmq-client-cpp] 01/02: findConsumerIds from same broker more time

Posted by if...@apache.org.
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 8c6f24d5cfcd9cf1c739ce14013b2eb4f4c3e254
Author: James Yin <yw...@hotmail.com>
AuthorDate: Sat May 9 17:17:22 2020 +0800

    findConsumerIds from same broker more time
---
 src/MQClientInstance.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/MQClientInstance.cpp b/src/MQClientInstance.cpp
index 1ac6516..213d74b 100644
--- a/src/MQClientInstance.cpp
+++ b/src/MQClientInstance.cpp
@@ -873,7 +873,7 @@ void MQClientInstance::findConsumerIds(const std::string& topic,
     std::lock_guard<std::mutex> lock(m_topicBrokerAddrTableMutex);
     const auto& it = m_topicBrokerAddrTable.find(topic);
     if (it != m_topicBrokerAddrTable.end()) {
-      if (UtilAll::currentTimeMillis() < it->second.second + 40000) {
+      if (UtilAll::currentTimeMillis() < it->second.second + 120000) {
         brokerAddr = it->second.first;
       }
     }