You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2023/02/23 15:15:06 UTC

[rocketmq-clients] 26/28: Add more response code cases

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

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

commit f4e4647c78b427acb3215eb2a6ff7a23ea4eeb07
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Wed Feb 22 19:07:02 2023 +0800

    Add more response code cases
---
 csharp/rocketmq-client-csharp/MessageView.cs   | 2 +-
 csharp/rocketmq-client-csharp/StatusChecker.cs | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/csharp/rocketmq-client-csharp/MessageView.cs b/csharp/rocketmq-client-csharp/MessageView.cs
index b88c40b4..21cd3677 100644
--- a/csharp/rocketmq-client-csharp/MessageView.cs
+++ b/csharp/rocketmq-client-csharp/MessageView.cs
@@ -36,7 +36,7 @@ namespace Org.Apache.Rocketmq
         private readonly long _offset;
         private readonly bool _corrupted;
 
-        internal MessageView(string messageId, string topic, byte[] body, string tag, string messageGroup,
+        private MessageView(string messageId, string topic, byte[] body, string tag, string messageGroup,
             DateTime? deliveryTimestamp, List<string> keys, Dictionary<string, string> properties, string bornHost,
             DateTime bornTime, int deliveryAttempt, MessageQueue messageQueue, string receiptHandle, long offset,
             bool corrupted)
diff --git a/csharp/rocketmq-client-csharp/StatusChecker.cs b/csharp/rocketmq-client-csharp/StatusChecker.cs
index 2802fd78..abc0b160 100644
--- a/csharp/rocketmq-client-csharp/StatusChecker.cs
+++ b/csharp/rocketmq-client-csharp/StatusChecker.cs
@@ -31,7 +31,7 @@ namespace Org.Apache.Rocketmq
             var statusCode = status.Code;
 
             var statusMessage = status.Message;
-            // TODO
+            // TODO: add request-id.
             switch (statusCode)
             {
                 case Proto.Code.Ok:
@@ -95,6 +95,12 @@ namespace Org.Apache.Rocketmq
                 case Proto.Code.VersionUnsupported:
                 case Proto.Code.VerifyFifoMessageUnsupported:
                     throw new UnsupportedException((int)statusCode, statusMessage);
+                // Not used code.
+                case Proto.Code.RequestTimeout:
+                case Proto.Code.PreconditionFailed:
+                case Proto.Code.NotImplemented:
+                case Proto.Code.FailedToConsumeMessage:
+                case Proto.Code.Unspecified:
                 default:
                     Logger.Warn($"Unrecognized status code={statusCode}, statusMessage={statusMessage}");
                     throw new UnsupportedException((int)statusCode, statusMessage);