You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2022/04/21 09:27:56 UTC
[rocketmq-apis] branch v2 updated: Refactor telemetry settings (#22)
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 1413ccf Refactor telemetry settings (#22)
1413ccf is described below
commit 1413ccf2f12829311448ceebfa73deab4b95c8de
Author: Aaron Ai <ya...@alibaba-inc.com>
AuthorDate: Thu Apr 21 17:27:52 2022 +0800
Refactor telemetry settings (#22)
---
apache/rocketmq/v2/definition.proto | 3 +-
apache/rocketmq/v2/service.proto | 129 +++++++++++++++---------------------
2 files changed, 54 insertions(+), 78 deletions(-)
diff --git a/apache/rocketmq/v2/definition.proto b/apache/rocketmq/v2/definition.proto
index f76601c..94c64b4 100644
--- a/apache/rocketmq/v2/definition.proto
+++ b/apache/rocketmq/v2/definition.proto
@@ -174,8 +174,7 @@ enum ClientType {
CLIENT_TYPE_UNSPECIFIED = 0;
PRODUCER = 1;
PUSH_CONSUMER = 2;
- PULL_CONSUMER = 3;
- SIMPLE_CONSUMER = 4;
+ SIMPLE_CONSUMER = 3;
}
enum Encoding {
diff --git a/apache/rocketmq/v2/service.proto b/apache/rocketmq/v2/service.proto
index a6245eb..e9840d0 100644
--- a/apache/rocketmq/v2/service.proto
+++ b/apache/rocketmq/v2/service.proto
@@ -179,102 +179,79 @@ message RecoverOrphanedTransactionCommand {
string transaction_id = 2;
}
-message ActivePublishingSettings {
+message Publishing {
+ // Publishing settings below here is appointed by client, thus it is
+ // unnecessary for server to push at present.
+ //
+ // Topic list to push message.
repeated Resource publishing_topics = 1;
RetryPolicy retry_policy = 2;
-}
-
-message ActiveSubscriptionSettings {
- Resource group = 1;
- repeated SubscriptionEntry subscriptions = 2;
- // Consume thread count is essential if `ClientType` is `PushConsumer`.
- optional int32 consume_thread_count = 3;
- // Consume max batch size is essential if `ClientType` is `PushConsumer`.
- optional int32 consume_max_batch_size = 4;
- // Max cache message bytes is essential if `ClientType` is `PushConsumer`.
- optional int64 max_cache_message_bytes = 5;
- // Await duration here is essential if `ClientType` is `SimpleConsumer`.
- optional google.protobuf.Duration simple_consumer_receive_await_duration = 6;
-}
-
-message ReportActiveSettingsCommand {
- string nonce = 1;
- ClientType client_type = 2;
- Endpoints access_point = 3;
- google.protobuf.Duration connection_timeout = 4;
- bool trace_on = 5;
- // Settings will be ignored by server if it is not match with the client type.
- oneof settings {
- ActivePublishingSettings active_publishing_settings = 6;
- ActiveSubscriptionSettings active_subscription_settings = 7;
- }
-}
-
-message ReportActiveSettingsResult { string nonce = 1; }
-message PassivePublishingSettings {
+ // Publishing settings below here are from server, it is essential for
+ // server to push.
+ //
// Message is compressed if the body size exceeds the threshold.
- int32 message_body_compression_bytes_threshold = 1;
+ int32 message_body_compression_bytes_threshold = 3;
// Publishing is rejected if the message body size exceeds the threshold.
- int32 max_message_body_bytes = 2;
- google.protobuf.Duration orphaned_transaction_recovery_duration = 3;
+ int32 max_message_body_bytes = 4;
}
-message PassiveSubscriptionSettings {
- bool fifo = 1;
- // Max fifo consume attempts is essential if `fifo` flag is true, a default
- // value of 17 is used if this parameter is not set.
- optional int32 max_fifo_delivery_attempts = 2;
- // Fifo consume retry interval is essential if `fifo` flag is true, a default
- // value of 1s is used if this parameter is not set.
- optional google.protobuf.Duration fifo_delivery_retry_interval = 3;
- // Message receive batch size here is essential if `ClientType` is
- // `PushConsumer`,
- optional int32 push_consumer_receive_batch_size = 4;
- // Long-polling timeout for `ReceiveMessageRequest`, which is essential if
- // `ClientType` is `PushCosnumer`. A default value of 30s is
- // used if this parameter is not set.
- optional google.protobuf.Duration push_consumer_receive_await_duration = 5;
- // Consume timeout is only works if the fifo flag is false. A default value of
- // 15min is used if this parameter is not set.
- optional google.protobuf.Duration consume_timeout = 6;
+message Subscription {
+ // Subscription settings below here is appointed by client, thus it is
+ // unnecessary for server to push at present.
+ //
+ // Consumer group.
+ optional Resource group = 1;
+ // Subscription for consumer.
+ repeated SubscriptionEntry subscriptions = 2;
+
+ // Subscription settings below here are from server, it is essential for
+ // server to push.
+ //
+ // Fifo consumption flag, which is essential for push consumer.
+ optional bool fifo = 3;
+ // Max fifo consume attempts is essential if `fifo` flag is true.
+ optional int32 max_fifo_delivery_attempts = 4;
+ // Fifo consume retry interval is essential if `fifo` flag is true.
+ optional google.protobuf.Duration fifo_delivery_retry_interval = 5;
+ // Message receive batch size here is essential for push consumer.
+ optional int32 push_consumer_receive_batch_size = 6;
+ // Long-polling timeout for `ReceiveMessageRequest`, which is essential for
+ // push consumer.
+ optional google.protobuf.Duration push_consumer_receive_await_duration = 7;
}
-message ApplyPassiveSettingsCommand {
- string nonce = 1;
- Endpoints trace_access_point = 2;
- // Settings will be ignored by server if it is not match with the client type.
- oneof settings {
- PassivePublishingSettings passive_publishing_settings = 3;
- PassiveSubscriptionSettings passive_subscription_settings = 4;
+message Settings {
+ // Common settings for all kind of clients.
+ //
+ optional ClientType client_type = 1;
+ optional Endpoints access_point = 2;
+ // Request timeout for RPCs except long-polling.
+ optional google.protobuf.Duration plain_request_duration = 3;
+
+ oneof pubsub {
+ Publishing publishing = 4;
+ Subscription subscription = 5;
}
}
-message ApplyPassiveSettingsResult { string nonce = 1; }
-
message TelemetryCommand {
oneof command {
+ Settings settings = 1;
// These messages are from client.
- // Report active setting to server.
- ReportActiveSettingsCommand report_active_settings_command = 1;
- // Ack `ApplyPassiveSettingsCommand` from server.
- ApplyPassiveSettingsResult apply_passive_settings_result = 2;
+ //
// Report thread stack trace to server.
- ThreadStackTrace thread_stack_trace = 3;
- // Repost message verify result to server.
- VerifyMessageResult verify_message_result = 4;
-
+ ThreadStackTrace thread_stack_trace = 2;
+ // Report message verify result to server.
+ VerifyMessageResult verify_message_result = 3;
// There messages are from server.
- // Deliver passive settings to client.
- ApplyPassiveSettingsCommand apply_passive_settings_command = 5;
- // Ack `ReportActiveSettingsCommand` from client.
- ReportActiveSettingsResult report_active_settings_result = 6;
+ //
// Request client to recover the orphaned transaction message.
- RecoverOrphanedTransactionCommand recover_orphaned_transaction_command = 7;
+ RecoverOrphanedTransactionCommand recover_orphaned_transaction_command = 4;
// Request client to print thread stack trace.
- PrintThreadStackTraceCommand print_thread_stack_trace_command = 8;
+ PrintThreadStackTraceCommand print_thread_stack_trace_command = 5;
// Request client to verify the consumption of the appointed message.
- VerifyMessageCommand verify_message_command = 9;
+ VerifyMessageCommand verify_message_command = 6;
}
}