You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2022/06/30 11:28:43 UTC

[rocketmq-clients] branch cpp updated: Translate ClientIdRequired to InternalClientError

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

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


The following commit(s) were added to refs/heads/cpp by this push:
     new 5d080d4  Translate ClientIdRequired to InternalClientError
5d080d4 is described below

commit 5d080d46142703294eef067af68fd99572161924
Author: Li Zhanhui <li...@gmail.com>
AuthorDate: Thu Jun 30 19:28:35 2022 +0800

    Translate ClientIdRequired to InternalClientError
---
 cpp/src/main/cpp/client/ClientManagerImpl.cpp          | 14 ++++++--------
 cpp/src/main/cpp/client/ReceiveMessageStreamReader.cpp |  2 +-
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/cpp/src/main/cpp/client/ClientManagerImpl.cpp b/cpp/src/main/cpp/client/ClientManagerImpl.cpp
index 0f4c7f5..1f9eec6 100644
--- a/cpp/src/main/cpp/client/ClientManagerImpl.cpp
+++ b/cpp/src/main/cpp/client/ClientManagerImpl.cpp
@@ -263,7 +263,7 @@ void ClientManagerImpl::heartbeat(const std::string& target_host, const Metadata
 
       case rmq::Code::CLIENT_ID_REQUIRED: {
         SPDLOG_ERROR("ClientIdRequired: {}. Host={}", status.message(), invocation_context->remote_address);
-        ec = ErrorCode::ClientIdRequired;
+        ec = ErrorCode::InternalClientError;
         cb(ec, invocation_context->response);
         break;
       }
@@ -633,7 +633,7 @@ void ClientManagerImpl::resolveRoute(const std::string& target_host, const Metad
 
       case rmq::Code::CLIENT_ID_REQUIRED: {
         SPDLOG_ERROR("ClientIdRequired: {}. Host={}", status.message(), invocation_context->remote_address);
-        ec = ErrorCode::ClientIdRequired;
+        ec = ErrorCode::InternalClientError;
         cb(ec, nullptr);
         break;
       }
@@ -707,7 +707,7 @@ void ClientManagerImpl::queryAssignment(
 
       case rmq::Code::CLIENT_ID_REQUIRED: {
         SPDLOG_WARN("ClientIdRequired: {}. Host={}", status.message(), invocation_context->remote_address);
-        ec = ErrorCode::ClientIdRequired;
+        ec = ErrorCode::InternalClientError;
         break;
       }
 
@@ -1039,7 +1039,7 @@ void ClientManagerImpl::ack(const std::string& target, const Metadata& metadata,
 
       case rmq::Code::CLIENT_ID_REQUIRED: {
         SPDLOG_WARN("ClientIdRequired: {}, host={}", status.message(), invocation_context->remote_address);
-        ec = ErrorCode::ClientIdRequired;
+        ec = ErrorCode::InternalClientError;
         break;
       }
 
@@ -1251,7 +1251,7 @@ void ClientManagerImpl::endTransaction(
 
       case rmq::Code::CLIENT_ID_REQUIRED: {
         SPDLOG_WARN("ClientIdRequired: {}, host={}", status.message(), peer_address);
-        ec = ErrorCode::ClientIdRequired;
+        ec = ErrorCode::InternalClientError;
         break;
       }
 
@@ -1352,9 +1352,7 @@ void ClientManagerImpl::forwardMessageToDeadLetterQueue(const std::string& targe
 
       case rmq::Code::CLIENT_ID_REQUIRED: {
         SPDLOG_WARN("IllegalTopic: {}. Host={}", status.message(), peer_address);
-
-        // TODO: translate to client internal error?
-        ec = ErrorCode::InternalServerError;
+        ec = ErrorCode::InternalClientError;
         break;
       }
 
diff --git a/cpp/src/main/cpp/client/ReceiveMessageStreamReader.cpp b/cpp/src/main/cpp/client/ReceiveMessageStreamReader.cpp
index 0684f51..af99874 100644
--- a/cpp/src/main/cpp/client/ReceiveMessageStreamReader.cpp
+++ b/cpp/src/main/cpp/client/ReceiveMessageStreamReader.cpp
@@ -82,7 +82,7 @@ void ReceiveMessageStreamReader::OnReadDone(bool ok) {
         }
 
         case rmq::Code::CLIENT_ID_REQUIRED: {
-          ec_ = ErrorCode::ClientIdRequired;
+          ec_ = ErrorCode::InternalClientError;
           break;
         }