/// <summary> /// Read configuration from BrokerConfigurationSection /// </summary> public static BrokerConfiguration FromConfigurationSection(BrokerConfigurationSection section) { var config = new BrokerConfiguration(); if (!String.IsNullOrWhiteSpace(section.StorageDirectory.Value)) { config.StorageDirectory = section.StorageDirectory.Value; } if (section.BrokerId.Value != 0) { config.BrokerId = section.BrokerId.Value; } if (!String.IsNullOrWhiteSpace(section.HostName.Value)) { config.HostName = section.HostName.Value; } if (section.Port.Value != 0) { config.Port = section.Port.Value; } if (section.PullPort.Value != 0) { config.PullPort = section.PullPort.Value; } if (section.NumberOfPartitions.Value != 0) { config.NumberOfPartitions = section.NumberOfPartitions.Value; } if (section.NumberOfPartitionsPerTopic != null) { foreach (var element in section.NumberOfPartitionsPerTopic) { var item = (TopicElement)element; config.NumberOfPartitionsPerTopic.Add(item.Topic, item.Partitions); } } return(config); }
public Flusher(BrokerConfiguration configuration, Store storage) { _configuration = configuration; _storage = storage; }
public Broker(BrokerConfiguration configuration) { _configuration = configuration; }
/// <summary> /// Read configuration from BrokerConfigurationSection /// </summary> public static BrokerConfiguration FromConfigurationSection(BrokerConfigurationSection section) { var config = new BrokerConfiguration(); if (!String.IsNullOrWhiteSpace(section.StorageDirectory.Value)) config.StorageDirectory = section.StorageDirectory.Value; if (section.BrokerId.Value != 0) config.BrokerId = section.BrokerId.Value; if (!String.IsNullOrWhiteSpace(section.HostName.Value)) config.HostName = section.HostName.Value; if (section.Port.Value != 0) config.Port = section.Port.Value; if (section.PullPort.Value != 0) config.PullPort = section.PullPort.Value; if (section.NumberOfPartitions.Value != 0) config.NumberOfPartitions = section.NumberOfPartitions.Value; if (section.NumberOfPartitionsPerTopic != null) { foreach (var element in section.NumberOfPartitionsPerTopic) { var item = (TopicElement)element; config.NumberOfPartitionsPerTopic.Add(item.Topic, item.Partitions); } } return config; }
public Broker(BrokerConfiguration configuration) { _configuration = configuration; }
public RequestHandlers(BrokerConfiguration configuration, Store storage) { _configuration = configuration; _storage = storage; }
public Flusher(BrokerConfiguration configuration, Store storage) { _configuration = configuration; _storage = storage; }
public RequestHandlers(BrokerConfiguration configuration, Store storage) { _configuration = configuration; _storage = storage; }
/// <summary> /// Creates Store /// </summary> public Store(BrokerConfiguration configuration) { _configuration = configuration; Init(); }