public Option(params Uri[] brokerUris) { if (brokerUris == null || brokerUris.Length == 0) { throw new ArgumentOutOfRangeException("brokerUris"); } _brokerUris = brokerUris; ProducerConfig = ProducerConfig.Default; ConsumerConfig = ConsumerConfig.Default; CoordinatorConfig = CoordinatorConfig.Default; }
static void Main(string[] args) { var config = new CoordinatorConfig(); if (args.Length > 0) { config.CoordinatorPort = int.Parse(args[1]); Console.WriteLine($"CoordinatorHost: http://localhost:{config.CoordinatorPort}/"); } using (var coordinator = new Coordinator(config)) { Console.ReadLine(); } }
public Option(String brokerUrls) { if (String.IsNullOrWhiteSpace(brokerUrls)) { throw new ArgumentOutOfRangeException("brokerUris"); } var brokerUris = brokerUrls.Split(',') .Select(x => new Uri(x.StartsWith("http://") ? x : "http://" + x)) .ToArray(); if (brokerUris.Length == 0) { throw new ArgumentOutOfRangeException("brokerUris"); } _brokerUris = brokerUris; ProducerConfig = ProducerConfig.Default; ConsumerConfig = ConsumerConfig.Default; CoordinatorConfig = CoordinatorConfig.Default; }