This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch java
in repository https://gitbox.apache.org/repos/asf/rocketmq-apis.git
The following commit(s) were added to refs/heads/java by this push:
new ab732d7 Update to the latest IDL
ab732d7 is described below
commit ab732d77742c7023decc66bd5f2b9f918fa079c0
Author: Aaron Ai <[email protected]>
AuthorDate: Mon Jun 12 15:33:17 2023 +0800
Update to the latest IDL
---
.../proto/apache/rocketmq/v2/definition.proto | 16 ++++++
.../proto/apache/rocketmq/v2/service.proto | 64 ++++++++++++++++++++++
2 files changed, 80 insertions(+)
diff --git a/src/main/resources/proto/apache/rocketmq/v2/definition.proto
b/src/main/resources/proto/apache/rocketmq/v2/definition.proto
index d10418d..02cbc4c 100644
--- a/src/main/resources/proto/apache/rocketmq/v2/definition.proto
+++ b/src/main/resources/proto/apache/rocketmq/v2/definition.proto
@@ -185,6 +185,7 @@ enum ClientType {
PRODUCER = 1;
PUSH_CONSUMER = 2;
SIMPLE_CONSUMER = 3;
+ PULL_CONSUMER = 4;
}
enum Encoding {
@@ -345,6 +346,8 @@ enum Code {
CLIENT_ID_REQUIRED = 40017;
// Polling time is illegal.
ILLEGAL_POLLING_TIME = 40018;
+ // Offset is illegal.
+ ILLEGAL_OFFSET = 40019;
// Generic code indicates that the client request lacks valid authentication
// credentials for the requested resource.
@@ -364,6 +367,8 @@ enum Code {
TOPIC_NOT_FOUND = 40402;
// Consumer group resource does not exist.
CONSUMER_GROUP_NOT_FOUND = 40403;
+ // Offset not found from server.
+ OFFSET_NOT_FOUND = 40404;
// Generic code representing client side timeout when connecting to, reading
data from, or write data to server.
REQUEST_TIMEOUT = 40800;
@@ -549,4 +554,15 @@ message Metric {
// The endpoint that client metrics should be exported to, which is required
if the switch is on.
optional Endpoints endpoints = 2;
+}
+
+enum QueryOffsetPolicy {
+ // Use this option if client wishes to playback all existing messages.
+ BEGINNING = 0;
+
+ // Use this option if client wishes to skip all existing messages.
+ END = 1;
+
+ // Use this option if time-based seek is targeted.
+ TIMESTAMP = 2;
}
\ No newline at end of file
diff --git a/src/main/resources/proto/apache/rocketmq/v2/service.proto
b/src/main/resources/proto/apache/rocketmq/v2/service.proto
index 6d203d4..513a103 100644
--- a/src/main/resources/proto/apache/rocketmq/v2/service.proto
+++ b/src/main/resources/proto/apache/rocketmq/v2/service.proto
@@ -97,6 +97,7 @@ message ReceiveMessageRequest {
// For message auto renew and clean
bool auto_renew = 6;
optional google.protobuf.Duration long_polling_timeout = 7;
+ optional string attempt_id = 8;
}
message ReceiveMessageResponse {
@@ -244,6 +245,54 @@ message ChangeInvisibleDurationResponse {
string receipt_handle = 2;
}
+message PullMessageRequest {
+ Resource group = 1;
+ MessageQueue message_queue = 2;
+ int64 offset = 3;
+ int32 batch_size = 4;
+ FilterExpression filter_expression = 5;
+ google.protobuf.Duration long_polling_timeout = 6;
+}
+
+message PullMessageResponse {
+ oneof content {
+ Status status = 1;
+ Message message = 2;
+ int64 next_offset = 3;
+ }
+}
+
+message UpdateOffsetRequest {
+ Resource group = 1;
+ MessageQueue message_queue = 2;
+ int64 offset = 3;
+}
+
+message UpdateOffsetResponse {
+ Status status = 1;
+}
+
+message GetOffsetRequest {
+ Resource group = 1;
+ MessageQueue message_queue = 2;
+}
+
+message GetOffsetResponse {
+ Status status = 1;
+ int64 offset = 2;
+}
+
+message QueryOffsetRequest {
+ MessageQueue message_queue = 1;
+ QueryOffsetPolicy query_offset_policy = 2;
+ optional google.protobuf.Timestamp timestamp = 3;
+}
+
+message QueryOffsetResponse {
+ Status status = 1;
+ int64 offset = 2;
+}
+
// For all the RPCs in MessagingService, the following error handling policies
// apply:
//
@@ -329,6 +378,21 @@ service MessagingService {
rpc ForwardMessageToDeadLetterQueue(ForwardMessageToDeadLetterQueueRequest)
returns (ForwardMessageToDeadLetterQueueResponse) {}
+ // PullMessage and ReceiveMessage RPCs serve a similar purpose,
+ // which is to attempt to get messages from the server, but with different
semantics.
+ rpc PullMessage(PullMessageRequest) returns (stream PullMessageResponse) {}
+
+ // Update the consumption progress of the designated queue of the
+ // consumer group to the remote.
+ rpc UpdateOffset(UpdateOffsetRequest) returns (UpdateOffsetResponse) {}
+
+ // Query the consumption progress of the designated queue of the
+ // consumer group to the remote.
+ rpc GetOffset(GetOffsetRequest) returns (GetOffsetResponse) {}
+
+ // Query the offset of the designated queue by the query offset policy.
+ rpc QueryOffset(QueryOffsetRequest) returns (QueryOffsetResponse) {}
+
// Commits or rollback one transactional message.
rpc EndTransaction(EndTransactionRequest) returns (EndTransactionResponse) {}