/// <summary> /// 启用数据中心 /// </summary> public static void UserConfigDataCenter(IBus _bus, string serverName) { try { bus = _bus; _configoptionDto = new ConfigOptionsDto(); _configoptionDto.APPKey = serverName; _configoptionDto.IsEnableLooppull = ConfigManage.IsEnableLooppull; _configoptionDto.IsUseConfigManage = ConfigManage.IsUseConfigManage; _configoptionDto.ConsulDataCenter = ZkConfig.DataCenterName; _configoptionDto.ConsulHost = "http://" + ZkConfig.WriteServerList[0]; _configoptionDto.ENVKey = ZkConfig.EnvName; _configoptionDto.ConsulTimeOut = ZkConfig.ConnectTimeOut; _configoptionDto.ConsulWaitTime = 30; RabbitMQRecive(); Looppull(); } catch (Exception ex) { LogService.Default.Fatal(ex, "启用配置中心出错" + ex.Message); } }
/// <summary> /// 启用数据中心 /// </summary> public static void UserConfigDataCenter(ConfigOptionsDto dto) { _configoptionDto = dto; RabbitMQRecive(); }