Browse Source

ydb stream consumer add: support service type

ref:c5a4e039f7bd047222cadded9a8bacdf6738f193
Alexey Bogolyubskiy 2 years ago
parent
commit
4ea16d185d

+ 6 - 0
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);

+ 1 - 0
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_;
     };