You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/03/28 09:46:18 UTC

[GitHub] [rocketmq-apis] lizhanhui commented on a change in pull request #15: Refactor the response common

lizhanhui commented on a change in pull request #15:
URL: https://github.com/apache/rocketmq-apis/pull/15#discussion_r836160634



##########
File path: apache/rocketmq/v2/service.proto
##########
@@ -31,13 +31,54 @@ option java_generate_equals_and_hash = true;
 option java_string_check_utf8 = true;
 option java_outer_classname = "MQService";
 
+enum ResponseCode {
+  // Success.
+  OK = 0;
+  // Aceess point in not specified in request.
+  ACCESS_POINT_NOT_SPECIFIED = 1;
+  // Format of topic is illegal.
+  ILLEGAL_TOPIC = 2;
+  // Format of consumer group is illegal.
+  ILLEGAL_CONSUMER_GROUP = 3;
+  // Format of message tag is illegal.
+  ILLEGAL_MESSAGE_TAG = 4;
+  // Format of message key is illegal.
+  ILLEGAL_MESSAGE_KEY = 5;
+  // Size of message keys exceeds the threshold.
+  MESSAGE_KEYS_TOO_LARGE = 6;
+  // Format of message group is illegal.
+  ILLEGAL_MESSAGE_GROUP = 7;
+  // Format of message property key is illegal.
+  ILLEGAL_MESSAGE_PROPERTY_KEY = 8;
+  // Message properties total size exceeds the threshold.
+  MESSAGE_PROPERTY_TOO_LARGE = 9;
+  // Message body size exceeds the threshold.
+  MESSAGE_BODY_TOO_LARGE = 10;
+  // User does have the permission to operate.
+  REQUEST_AUTHORISATION_FAILURE = 11;
+  // User's identity could not be recognized.
+  REQUEST_AUTHENTICATION_FAILURE = 12;
+  // Topic resource does not exist.
+  TOPIC_DOES_NOT_EXIST = 13;
+  // Consumer group resource does not exist.
+  CONSUMER_GROUP_DOES_NOT_EXIST = 14;
+  // Current operation is not supported by responder.
+  OPERATION_NOT_SUPPORTED = 15;
+  // Failure to consume message.
+  FAILED_TO_CONSUME_MESSAGE = 16;
+  // Message is corrupted.
+  MESSAGE_CORRUPTED = 17;
+  // Flow control.
+  FLOW_CONTROL = 18;
+  // Request is expired.
+  REQUEST_EXPIRED = 19;
+  // Message type is not matched.
+  MESSAGE_TYPE_NOT_MATCHED = 20;
+}
+
 message ResponseCommon {

Review comment:
       Rename it to Status?

##########
File path: apache/rocketmq/v2/service.proto
##########
@@ -31,13 +31,54 @@ option java_generate_equals_and_hash = true;
 option java_string_check_utf8 = true;
 option java_outer_classname = "MQService";
 
+enum ResponseCode {

Review comment:
       IMO, we should divide error code into different ranges, similar to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org