diff options
author | Alexey Bogolyubskiy <i@bogolyubskiyalexey.ru> | 2022-05-16 18:20:42 +0300 |
---|---|---|
committer | Alexey Bogolyubskiy <i@bogolyubskiyalexey.ru> | 2022-05-16 18:20:42 +0300 |
commit | 4ea16d185db34b55811bea35c9f31a6ae5d375d4 (patch) | |
tree | dbd2c48a6bbff0abf817f257e9d98f2965c89743 | |
parent | a217465e504309f491e4bfc1662393cf7fedd3cb (diff) | |
download | ydb-4ea16d185db34b55811bea35c9f31a6ae5d375d4.tar.gz |
ydb stream consumer add: support service type
ref:c5a4e039f7bd047222cadded9a8bacdf6738f193
-rw-r--r-- | ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp | 6 | ||||
-rw-r--r-- | ydb/public/lib/ydb_cli/commands/ydb_service_stream.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp index 24b478f8810..7b4c9efa750 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp @@ -209,6 +209,9 @@ namespace NYdb::NConsoleClient { config.Opts->AddLongOption("consumer-name", "New consumer for stream") .Required() .StoreResult(&ConsumerName_); + config.Opts->AddLongOption("service-type", "Service type of reader") + .Optional() + .StoreResult(&ServiceType_); config.Opts->AddLongOption("starting-message-timestamp", "Unix timestamp starting from '1970-01-01 00:00:00' from which read is allowed") .Optional() .StoreResult(&StartingMessageTimestamp_); @@ -230,6 +233,9 @@ namespace NYdb::NConsoleClient { if (StartingMessageTimestamp_.Defined()) { readRuleSettings.StartingMessageTimestamp(TInstant::Seconds(*StartingMessageTimestamp_.Get())); } + if (ServiceType_.Defined()) { + readRuleSettings.ServiceType(ServiceType_.GetRef()); + } auto addReadRuleSettings = NYdb::NPersQueue::TAddReadRuleSettings(); addReadRuleSettings.ReadRule(readRuleSettings); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.h b/ydb/public/lib/ydb_cli/commands/ydb_service_stream.h index f16d3b39b74..3a1248321b6 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.h +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_stream.h @@ -74,6 +74,7 @@ namespace NYdb::NConsoleClient { private: TString ConsumerName_; + TMaybe<TString> ServiceType_; TMaybe<ui64> StartingMessageTimestamp_; }; |