public CandlePublishersModule(
     CandlesPublicationRabbitSettings candlesPublicationRabbitSettings,
     CandlesProducerSettingsContract candlesProducerSettings)
 {
     _candlesPublicationRabbitSettings = candlesPublicationRabbitSettings;
     _candlesProducerSettings          = candlesProducerSettings;
     _services = new ServiceCollection();
 }
        private void LoadConfiguration()
        {
            // load service settings
            _mtSettingsManager = Configuration.LoadSettings <AppSettings>();

            // load candles sharding settings from settings service
            var candlesSettingsClientBuilder = HttpClientGenerator.HttpClientGenerator
                                               .BuildForUrl(_mtSettingsManager.CurrentValue.Assets.ServiceUrl)
                                               .WithAdditionalCallsWrapper(new ExceptionHandlerCallsWrapper());

            if (!string.IsNullOrWhiteSpace(_mtSettingsManager.CurrentValue.Assets.ApiKey))
            {
                candlesSettingsClientBuilder =
                    candlesSettingsClientBuilder.WithApiKey(_mtSettingsManager.CurrentValue.Assets.ApiKey);
            }

            var candlesSettingsClient = candlesSettingsClientBuilder.Create().Generate <ICandlesSettingsApi>();

            _candlesProducerSettings = candlesSettingsClient.GetProducerSettingsAsync().GetAwaiter().GetResult();
        }