public static IRegistryService GetRegistryService()
 {
     return(_service ??= new RegistryService.RegistryService(new ServiceTimer(),
                                                             RabbitBootstrapper.GetRabbitServer(),
                                                             new RegistryServiceConfigurator
     {
         NoTrafficTimerIntervalSeconds = Service.Config.ServiceConfiguration.ControllerConfiguration.MSTimeout,
         RegisterWithController =
             Service.Config.ServiceConfiguration.ControllerConfiguration.RegisterWithController,
         ServiceId = Service.Config.ServiceConfiguration.ServiceId,
         Version = Service.Config.ServiceConfiguration.ServiceVersion,
         ServerUri = Service.Config.ServiceConfiguration.ServiceUri,
         RegistryRabbitConfig = new RabbitExchangeConfigurator
         {
             ExchangeName = Service.Config.ServiceConfiguration.ControllerConfiguration.ControllerExchange,
             HostName = Service.Config.ServiceConfiguration.ControllerConfiguration.RabbitHostName,
             Password = Service.Config.ServiceConfiguration.ControllerConfiguration.RabbitPassword,
             Port = Service.Config.ServiceConfiguration.ControllerConfiguration.RabbitPort,
             UserName = Service.Config.ServiceConfiguration.ControllerConfiguration.RabbitUserName
         }
     },
                                                             LoggingBootstrapper.GetLogger()));
 }
Пример #2
0
 private static void LogUnauthorizedNetworkCall(HttpContext context, int duration = 0)
 {
     LoggingBootstrapper.GetLogger().Network(context.Request.Method,
                                             HttpStatusCode.Unauthorized, context.Request.Path, duration,
                                             Service.Config.ServiceConfiguration?.ServiceId);
 }