using System;
using System.Collections.Generic;
using System.Text;
using Wicture.DbRESTFul.Configuration;

namespace JiaZhiQuan.Common.Messaging
{
    public class KafkaClientConfig
    {
        public const string ConfigSectionName = "KafkaClientConfig";

        public string BootstrapServers { get; set; }
        public string GroupId { get; set; }

        public static KafkaClientConfig GetFromConfig()
        {
            if (ConfigurationManager.Settings.Document.ContainsKey(KafkaClientConfig.ConfigSectionName))
            {
                return ConfigurationManager.Settings.GetConfig<KafkaClientConfig>(ConfigSectionName);
            }
            return new KafkaClientConfig();
        }
    }
}
