Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 public Flusher(BrokerConfiguration configuration, Store storage)
 {
     _configuration = configuration;
     _storage = storage;
 }
Ejemplo n.º 3
0
 public Broker(BrokerConfiguration configuration)
 {
     _configuration = configuration;
 }
Ejemplo n.º 4
0
        /// <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;
        }
Ejemplo n.º 5
0
 public Broker(BrokerConfiguration configuration)
 {
     _configuration = configuration;
 }
Ejemplo n.º 6
0
 public RequestHandlers(BrokerConfiguration configuration, Store storage)
 {
     _configuration = configuration;
     _storage = storage;
 }
Ejemplo n.º 7
0
 public Flusher(BrokerConfiguration configuration, Store storage)
 {
     _configuration = configuration;
     _storage       = storage;
 }
Ejemplo n.º 8
0
 public RequestHandlers(BrokerConfiguration configuration, Store storage)
 {
     _configuration = configuration;
     _storage       = storage;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates Store
 /// </summary>
 public Store(BrokerConfiguration configuration)
 {
     _configuration = configuration;
     Init();
 }