This is an automated email from the ASF dual-hosted git repository.
lizhanhui pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/rocketmq-apis.git
The following commit(s) were added to refs/heads/v2 by this push:
new b0ad92c Minor fix
b0ad92c is described below
commit b0ad92c986d69b77465345bed7d1584bb80ac0a8
Author: Li Zhanhui <[email protected]>
AuthorDate: Mon Mar 21 13:00:09 2022 +0000
Minor fix
---
apache/rocketmq/v2/definition.proto | 68 ++++++++++++-------------------------
apache/rocketmq/v2/service.proto | 50 +++++++++++++--------------
2 files changed, 44 insertions(+), 74 deletions(-)
diff --git a/apache/rocketmq/v2/definition.proto
b/apache/rocketmq/v2/definition.proto
index e20c2f6..7509314 100644
--- a/apache/rocketmq/v2/definition.proto
+++ b/apache/rocketmq/v2/definition.proto
@@ -80,24 +80,6 @@ message Resource {
string name = 2;
}
-enum ConsumePolicy {
- CONSUME_POLICY_UNSPECIFIED = 0;
-
- // Clients are expecting to resume, continuing from positions where they
previously progressed.
- // Normally, servers shall save `offsets` for each client.
- RESUME = 1;
-
- // Clients using this policy expects servers to deliver all existing
messages, ignoring previous progress made.
- PLAYBACK = 2;
-
- // Clients using this policy expects servers to discard all existings
messages and deliver messages that arrives
- // after the connection is established.
- DISCARD = 3;
-
- // Clients accepts messages whose `born_time` is equal or greater than
specified timestamp.
- TARGET_TIMESTAMP = 4;
-}
-
enum ConsumeMessageType {
CONSUME_MESSAGE_TYPE_UNSPECIFIED = 0;
ACTIVE = 1;
@@ -109,13 +91,11 @@ message ConsumerData {
repeated SubscriptionEntry subscriptions = 2;
- ConsumePolicy consume_policy = 3;
-
- DeadLetterPolicy dead_letter_policy = 4;
+ DeadLetterPolicy dead_letter_policy = 3;
- ConsumeMessageType consume_type = 5;
+ ConsumeMessageType consume_type = 4;
- bool fifo = 6;
+ bool fifo = 5;
}
message SubscriptionEntry {
@@ -155,7 +135,7 @@ message Broker {
Endpoints endpoints = 3;
}
-message Partition {
+message MessageQueue {
Resource topic = 1;
int32 id = 2;
Permission permission = 3;
@@ -180,7 +160,8 @@ enum MessageType {
}
enum DigestType {
- UNKNOWN = 0;
+ DIGEST_TYPE_UNSPECIFIED = 0;
+
// CRC algorithm achieves goal of detecting random data error with lowest
// computation overhead.
CRC32 = 1;
@@ -252,44 +233,39 @@ message SystemAttribute {
// Time-point at which the message is stored in the broker.
google.protobuf.Timestamp store_timestamp = 9;
- // The broker that stores this message. It may be name, IP or arbitrary
- // identifier that uniquely identify the broker.
+ // The broker that stores this message. It may be broker name, IP or
arbitrary
+ // identifier that uniquely identify the server.
string store_host = 10;
- oneof timed_delivery {
- // Time-point at which broker delivers to clients.
- google.protobuf.Timestamp delivery_timestamp = 11;
-
- // Level-based delay strategy.
- int32 delay_level = 12;
- }
+ // Time-point at which broker delivers to clients.
+ google.protobuf.Timestamp delivery_timestamp = 11;
// If a message is acquired by way of POP, this field holds the receipt.
// Clients use the receipt to acknowledge or negatively acknowledge the
// message.
- string receipt_handle = 13;
+ string receipt_handle = 12;
- // Partition identifier in which a message is physically stored.
- int32 partition_id = 14;
+ // Message queue identifier in which a message is physically stored.
+ int32 queue_id = 13;
- // Partition offset at which a message is stored.
- int64 partition_offset = 15;
+ // Message-queue offset at which a message is stored.
+ int64 queue_offset = 14;
// Period of time servers would remain invisible once a message is acquired.
- google.protobuf.Duration invisible_period = 16;
+ google.protobuf.Duration invisible_duration = 15;
// Business code may failed to process messages for the moment. Hence,
clients
// may request servers to deliver them again using certain back-off strategy,
// the attempt is 1 not 0 if message is delivered first time.
- int32 delivery_attempt = 17;
+ int32 delivery_attempt = 16;
- string message_group = 18;
+ string message_group = 17;
// Trace context.
- string trace_context = 19;
+ string trace_context = 18;
// Delay time of first recover orphaned transaction request from server.
- google.protobuf.Duration orphaned_transaction_recovery_period = 20;
+ google.protobuf.Duration orphaned_transaction_recovery_duration = 19;
}
message Message {
@@ -308,9 +284,7 @@ message Message {
bytes body = 4;
}
-message Assignment {
- Partition Partition = 1;
-}
+message Assignment { MessageQueue message_queue = 1; }
enum QueryOffsetPolicy {
QUERY_OFFSET_POLICY_UNSPECIFIED = 0;
diff --git a/apache/rocketmq/v2/service.proto b/apache/rocketmq/v2/service.proto
index 43cd986..75b41ab 100644
--- a/apache/rocketmq/v2/service.proto
+++ b/apache/rocketmq/v2/service.proto
@@ -50,7 +50,7 @@ message ResponseCommon {
// failed to maintain alive status.
//
// Name servers answer queries of QueryRouteRequest, responding clients with
-// addressable partitions, which they may directly publish messages to or
+// addressable message-queues, which they may directly publish messages to or
// subscribe messages from.
//
// QueryRouteRequest shall include source endpoints, aka, configured
@@ -66,12 +66,12 @@ message QueryRouteRequest {
message QueryRouteResponse {
ResponseCommon common = 1;
- repeated Partition partitions = 2;
+ repeated MessageQueue message_queues = 2;
}
message SendMessageRequest {
repeated Message messages = 1;
- Partition partition = 2;
+ MessageQueue message_queue = 2;
}
message SendMessageResponse {
@@ -96,14 +96,13 @@ message QueryAssignmentResponse {
message ReceiveMessageRequest {
Resource group = 1;
string client_id = 2;
- Partition partition = 3;
+ MessageQueue message_queue = 3;
FilterExpression filter_expression = 4;
- ConsumePolicy consume_policy = 5;
- google.protobuf.Timestamp initialization_timestamp = 6;
- int32 batch_size = 7;
- google.protobuf.Duration invisible_duration = 8;
- google.protobuf.Duration await_time = 9;
- bool fifo_flag = 10;
+ google.protobuf.Timestamp initialization_timestamp = 5;
+ int32 batch_size = 6;
+ google.protobuf.Duration invisible_duration = 7;
+ google.protobuf.Duration await_duration = 8;
+ bool fifo = 9;
}
message ReceiveMessageResponse {
@@ -117,11 +116,8 @@ message AckMessageRequest {
Resource group = 1;
Resource topic = 2;
string client_id = 3;
- oneof handle {
- string receipt_handle = 4;
- int64 offset = 5;
- }
- string message_id = 6;
+ string receipt_handle = 4;
+ string message_id = 5;
}
message AckMessageResponse {
@@ -174,7 +170,7 @@ message EndTransactionResponse {
}
message QueryOffsetRequest {
- Partition partition = 1;
+ MessageQueue message_queue = 1;
QueryOffsetPolicy policy = 2;
google.protobuf.Timestamp time_point = 3;
}
@@ -186,7 +182,7 @@ message QueryOffsetResponse {
message PullMessageRequest {
Resource group = 1;
- Partition partition = 2;
+ MessageQueue message_queue = 2;
int64 offset = 3;
int32 batch_size = 4;
google.protobuf.Duration await_time = 5;
@@ -293,8 +289,8 @@ service MessagingService {
// Queries the route entries of the requested topic in the perspective of the
// given endpoints. On success, servers should return a collection of
- // addressable partitions. Note servers may return customized route entries
- // based on endpoints provided.
+ // addressable message-queues. Note servers may return customized route
+ // entries based on endpoints provided.
//
// If the requested topic doesn't exist, returns `NOT_FOUND`.
// If the specific endpoints is emtpy, returns `INVALID_ARGUMENT`.
@@ -317,7 +313,7 @@ service MessagingService {
// Delivers messages to brokers.
// Clients may further:
- // 1. Refine a message destination to topic partition which fulfills parts of
+ // 1. Refine a message destination to message-queues which fulfills parts of
// FIFO semantic;
// 2. Flag a message as transactional, which keeps it invisible to consumers
// until it commits;
@@ -330,7 +326,7 @@ service MessagingService {
// If the destination topic doesn't exist, returns `NOT_FOUND`.
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse) {}
- // Queries the assigned partition route info of a topic for current consumer,
+ // Queries the assigned route info of a topic for current consumer,
// the returned assignment result is decided by server-side load balancer.
//
// If the corresponding topic doesn't exist, returns `NOT_FOUND`.
@@ -367,14 +363,14 @@ service MessagingService {
// Commits or rollback one transactional message.
rpc EndTransaction(EndTransactionRequest) returns (EndTransactionResponse) {}
- // Queries the offset of the specific partition, returns the offset with `OK`
- // if success. The message server should maintain a numerical offset for each
- // message in a partition.
+ // Queries the offset of the specific message queue, returns the offset with
+ // `OK` if success. The message server should maintain a numerical offset for
+ // each message in a message-queue.
rpc QueryOffset(QueryOffsetRequest) returns (QueryOffsetResponse) {}
- // Pulls messages from the specific partition, returns a set of messages with
- // next pull offset. The pulled messages can't be acked or nacked, while the
- // client is responsible for manage offsets for consumer, typically update
+ // Pulls messages from the specific message-queue, returns a set of messages
+ // with next pull offset. The pulled messages can't be acked or nacked, while
+ // the client is responsible for manage offsets for consumer, typically
update
// consume offset to local memory or a third-party storage service.
//
// If the pending concurrent receive requests exceed the quota of the given