internal static ZooKeeperClientConfigure ReadZooKeeperClientConfigure(IConfigurationSection configurationSection) { var client = new ZooKeeperClientConfigure(); if (configurationSection.Exists()) { var connection = configurationSection.GetSection("ConnectionString"); if (connection.Exists()) { client.ConnectionString = connection.Value; } var sessionTimeout = configurationSection.GetSection("SessionTimeout"); if (sessionTimeout.Exists()) { client.SessionTimeout = int.Parse(sessionTimeout.Value); } var canBeReadOnly = configurationSection.GetSection("CanBeReadOnly"); if (canBeReadOnly.Exists()) { client.CanBeReadOnly = bool.Parse(canBeReadOnly.Value); } } return(client); }
public static void AddZooKeeper(this IUraganoBuilder builder, ZooKeeperClientConfigure zookeeperClientConfiguration) { builder.AddServiceDiscovery <ZooKeeperServiceDiscovery>(zookeeperClientConfiguration); }