/// <summary> /// 初始化,生成一个全局唯一的 activeMqService /// </summary> /// <param name="connection">链接地址</param> /// <param name="user">登录名</param> /// <param name="password">登录密码</param> public static void Init(string connection, string user, string password) { ActiveMqHelper.connection = connection; ActiveMqHelper.user = user; ActiveMqHelper.password = password; activeMqService = new ActiveMqService(ActiveMqHelper.connection, ActiveMqHelper.user, ActiveMqHelper.password, TimeSpan.FromSeconds(HmiConfig.MqSendRequestTimeoutSec)); }
static OnlineDataCenter() { serverPort = int.Parse(Configuration.ServerPort); serverIP = IPAddress.Parse(Configuration.ServerIp); AppEventsManager.OnUpdateDataServer += Aem_OnUpdateDataServer; activeMq = new ActiveMqService("failover:(tcp://192.168.200.100:61616)?timeout=300", "admin", "admin", TimeSpan.FromMinutes(1)); }
/// <summary> /// 初始化各个 Effect /// </summary> /// <param name="mqService"></param> public MqEffects(MqService mqService) { UnityIocService.AssertIsFirstInject(GetType()); activeMq = ActiveMqHelper.GetActiveMqService(); Logger = LoggerHelper.CreateLogger(GetType().ToString()); this.mqService = mqService; initSchTaskEffect(); initUploadCpmsEffect(); initStartUploadCpmsIntervalEffect(); initStartListenScanMaterial(); initUploadAlarm(); initUploadSchTaskManu(); initStartListenEmpRfid(); initStartListenAxisRfid(); initUploadDpms(); initCallSystem(); initStartListenCmd(); initUploadElecPower(); }