public async Task can_create_persistent_subscription() { var client = new PersistentSubscriptions.PersistentSubscriptionsClient(Channel); var settings = new CreateReq.Types.Settings { CheckpointAfterMs = 10000, ExtraStatistics = true, MaxCheckpointCount = 20, MinCheckpointCount = 10, MaxRetryCount = 30, MaxSubscriberCount = 40, MessageTimeoutMs = 20000, HistoryBufferSize = 60, LiveBufferSize = 10, ReadBatchSize = 50 }; if (_legacy) { #pragma warning disable 612 settings.NamedConsumerStrategy = CreateReq.Types.ConsumerStrategy.Pinned; #pragma warning restore 612 } else { settings.ConsumerStrategy = "Pinned"; } await client.CreateAsync( new CreateReq { Options = new CreateReq.Types.Options { GroupName = "group", Stream = new CreateReq.Types.StreamOptions { Start = new Empty(), StreamIdentifier = new StreamIdentifier { StreamName = ByteString.CopyFromUtf8("stream") } }, Settings = settings } }, GetCallOptions(AdminCredentials)); }
private CreateReq.Types.Settings WithoutExtraStatistics(CreateReq.Types.Settings settings) { settings.ExtraStatistics = false; return(settings); }