Skip to content

Commit f2597b8

Browse files
authored
[ISSUE #94] Proto enhancement for "RIP‐83 Lite Topic" (#95)
1 parent f4e9239 commit f2597b8

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

apache/rocketmq/v2/definition.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ enum MessageType {
146146
// Messages that are transactional. Only committed messages are delivered to
147147
// subscribers.
148148
TRANSACTION = 4;
149+
150+
// lite topic
151+
LITE = 5;
149152
}
150153

151154
enum DigestType {
@@ -186,6 +189,8 @@ enum ClientType {
186189
PUSH_CONSUMER = 2;
187190
SIMPLE_CONSUMER = 3;
188191
PULL_CONSUMER = 4;
192+
LITE_PUSH_CONSUMER = 5;
193+
LITE_SIMPLE_CONSUMER = 6;
189194
}
190195

191196
enum Encoding {
@@ -270,6 +275,9 @@ message SystemProperties {
270275

271276
// Information to identify whether this message is from dead letter queue.
272277
optional DeadLetterQueue dead_letter_queue = 20;
278+
279+
// lite topic
280+
optional string lite_topic = 21;
273281
}
274282

275283
message DeadLetterQueue {
@@ -348,6 +356,8 @@ enum Code {
348356
ILLEGAL_POLLING_TIME = 40018;
349357
// Offset is illegal.
350358
ILLEGAL_OFFSET = 40019;
359+
// Format of lite topic is illegal.
360+
ILLEGAL_LITE_TOPIC = 40020;
351361

352362
// Generic code indicates that the client request lacks valid authentication
353363
// credentials for the requested resource.
@@ -389,6 +399,10 @@ enum Code {
389399
// Requests are throttled.
390400
TOO_MANY_REQUESTS = 42900;
391401

402+
// LiteTopic related quota exceeded
403+
LITE_TOPIC_QUOTA_EXCEEDED = 42901;
404+
LITE_SUBSCRIPTION_QUOTA_EXCEEDED = 42902;
405+
392406
// Generic code for the case that the server is unwilling to process the request because its header fields are too large.
393407
// The request may be resubmitted after reducing the size of the request header fields.
394408
REQUEST_HEADER_FIELDS_TOO_LARGE = 43100;
@@ -548,6 +562,21 @@ message Subscription {
548562
// Long-polling timeout for `ReceiveMessageRequest`, which is essential for
549563
// push consumer.
550564
optional google.protobuf.Duration long_polling_timeout = 5;
565+
566+
// Only lite push consumer
567+
// client-side lite subscription quota limit
568+
optional int32 lite_subscription_quota = 6;
569+
570+
// Only lite push consumer
571+
// Maximum length limit for lite topic
572+
optional int32 max_lite_topic_size = 7;
573+
}
574+
575+
enum LiteSubscriptionAction {
576+
PARTIAL_ADD = 0;
577+
PARTIAL_REMOVE = 1;
578+
COMPLETE_ADD = 2;
579+
COMPLETE_REMOVE = 3;
551580
}
552581

553582
message Metric {

apache/rocketmq/v2/service.proto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ message ReceiveMessageResponse {
114114
message AckMessageEntry {
115115
string message_id = 1;
116116
string receipt_handle = 2;
117+
optional string lite_topic = 3;
117118
}
118119

119120
message AckMessageRequest {
@@ -148,6 +149,7 @@ message ForwardMessageToDeadLetterQueueRequest {
148149
string message_id = 4;
149150
int32 delivery_attempt = 5;
150151
int32 max_delivery_attempts = 6;
152+
optional string lite_topic = 7;
151153
}
152154

153155
message ForwardMessageToDeadLetterQueueResponse { Status status = 1; }
@@ -193,6 +195,10 @@ message RecoverOrphanedTransactionCommand {
193195
string transaction_id = 2;
194196
}
195197

198+
message NotifyUnsubscribeLiteCommand {
199+
string lite_topic = 1;
200+
}
201+
196202
message TelemetryCommand {
197203
optional Status status = 1;
198204

@@ -221,6 +227,9 @@ message TelemetryCommand {
221227

222228
// Request client to reconnect server use the latest endpoints.
223229
ReconnectEndpointsCommand reconnect_endpoints_command = 8;
230+
231+
// Request client to unsubscribe lite topic.
232+
NotifyUnsubscribeLiteCommand notify_unsubscribe_lite_command = 9;
224233
}
225234
}
226235

@@ -311,6 +320,21 @@ message RecallMessageResponse {
311320
string message_id = 2;
312321
}
313322

323+
message SyncLiteSubscriptionRequest {
324+
LiteSubscriptionAction action = 1;
325+
// bindTopic for lite push consumer
326+
Resource topic = 2;
327+
// consumer group
328+
Resource group = 3;
329+
// lite subscription set of lite topics
330+
repeated string lite_topic_set = 4;
331+
optional int64 version = 5;
332+
}
333+
334+
message SyncLiteSubscriptionResponse {
335+
Status status = 1;
336+
}
337+
314338
// For all the RPCs in MessagingService, the following error handling policies
315339
// apply:
316340
//
@@ -440,4 +464,8 @@ service MessagingService {
440464
// for normal message, not supported for now.
441465
rpc RecallMessage(RecallMessageRequest) returns (RecallMessageResponse) {
442466
}
467+
468+
// Sync lite subscription info, lite push consumer only
469+
rpc SyncLiteSubscription(SyncLiteSubscriptionRequest) returns (SyncLiteSubscriptionResponse) {}
470+
443471
}

java/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.5
1+
2.1.0

0 commit comments

Comments
 (0)