/// <summary>
        /// Creates an appropriatly configured HttpClient that will be used in communicating with the
        /// Spring Cloud Configuration Server
        /// </summary>
        /// <param name="settings">the settings used in configuring the HttpClient</param>
        /// <returns>The HttpClient used by the provider</returns>
        protected static INacosConfigClient GetNacosClient(ConfigNacosClientSettings settings, IHttpClientFactory clientFactory, ILocalConfigInfoProcessor processor, ILoggerFactory loggerFactory = null)
        {
            NacosClientConfiguration nacosClientConfiguration = new NacosClientConfiguration()
            {
                ServerAddresses = settings.ServerAddr,
                IsSecure        = settings.IsSecure,
                ServiceName     = settings.Name
            };

            return(new NacosConfigClient(loggerFactory, nacosClientConfiguration, clientFactory, processor));
        }
Exemplo n.º 2
0
        public NacosConfigClient(
            ILoggerFactory loggerFactory
            , NacosClientConfiguration optionAccs
            , IHttpClientFactory clientFactory
            , ILocalConfigInfoProcessor processor)
        {
            this._logger        = loggerFactory.CreateLogger <NacosConfigClient>();
            this._options       = optionAccs;
            this._clientFactory = clientFactory;
            this._processor     = processor;

            this.listeners             = new List <Listener>();
            this._serverAddressManager = new ServerAddressManager(_options);
        }