@@ -11,43 +11,14 @@ namespace TopicService;
1111
1212public class SloTopicContext : ISloContext
1313{
14- private const string PathTopic = "/Root/pixcc-slice-db /slo-topic" ;
14+ private const string PathTopic = "/Root/testdb /slo-topic" ;
1515 private const string ConsumerName = "Consumer" ;
1616 private const int PartitionSize = 10 ;
1717
1818 private static readonly ILogger Logger = ISloContext . Factory . CreateLogger < SloTopicContext > ( ) ;
1919
2020 public async Task Create ( CreateConfig config )
2121 {
22- // var splitEndpoint = config.Endpoint.Split("://");
23- // var useTls = splitEndpoint[0] switch
24- // {
25- // "grpc" => false,
26- // "grpcs" => true,
27- // _ => throw new ArgumentException("Don't support schema: " + splitEndpoint[0])
28- // };
29- //
30- // var host = splitEndpoint[1].Split(":")[0];
31- // var port = splitEndpoint[1].Split(":")[1];
32- //
33- // await using var connection = new YdbConnection(new YdbConnectionStringBuilder
34- // {
35- // UseTls = useTls, Host = host, Port = int.Parse(port), Database = config.Db,
36- // LoggerFactory = ISloContext.Factory
37- // });
38- // await connection.OpenAsync();
39- //
40- // await new YdbCommand(connection)
41- // {
42- // CommandText = @"
43- // CREATE TOPIC `/Root/testdb/slo-topic` (
44- // CONSUMER Consumer
45- // ) WITH (min_active_partitions = 10);
46- //
47- // CREATE USER user PASSWORD password;
48- // "
49- // }.ExecuteNonQueryAsync();
50-
5122 var topicClient = new TopicClient ( await Driver . CreateInitialized (
5223 new DriverConfig ( config . Endpoint , config . Db ) , ISloContext . Factory )
5324 ) ;
0 commit comments