public virtual void SendCommandToRedistReStart(int mqpathid, EnumCommandReceiver receivier) { using (DbConn conn = DbConfig.CreateConn(DataConfig.MqManage)) { conn.Open(); var model = new tb_mqpath_dal().Get(conn, mqpathid); RedisHelper.SendMessage(DataConfig.RedisServer, XXF.BaseService.MessageQuque.BusinessMQ.SystemRuntime.SystemParamConfig.Redis_Channel, new XXF.BaseService.MessageQuque.BusinessMQ.SystemRuntime.BusinessMQNetCommand() { MqPath = model.mqpath, CommandType = EnumCommandType.Register, CommandReceiver = receivier }); } }
public virtual void ReStartQuque(int mqpathid) { tb_mqpath_model model; using (DbConn conn = DbConfig.CreateConn(DataConfig.MqManage)) { try { conn.Open(); conn.BeginTransaction(); model = new tb_mqpath_dal().Get(conn, mqpathid); new tb_mqpath_dal().UpdateLastUpdateTime(conn, mqpathid); conn.Commit(); } catch (Exception exp) { conn.Rollback(); throw exp; } SendCommandToRedistReStart(mqpathid, EnumCommandReceiver.All); } }
public JsonResult GetDayList(string node, string tablepartition) { try { string mqpath = ""; using (DbConn conn = DbConfig.CreateConn(DataConfig.MqManage)) { conn.Open(); tb_mqpath_dal mqpathdal = new tb_mqpath_dal(); var model = mqpathdal.GetByPartitionID(conn, PartitionRuleHelper.GetPartitionID(new PartitionIDInfo() { DataNodePartition = Convert.ToInt32(node), TablePartition = Convert.ToInt32(tablepartition) })); if(model!=null) mqpath = model.mqpath; } using (DbConn conn = DbConfig.CreateConn(DataConfig.DataNodeParConn(node))) { conn.Open(); var array = new tb_messagequeue_dal().GetDayPartitions(conn, Convert.ToInt32(tablepartition)).Select(c => c.ToString("yyMMdd")).ToList(); if (array != null && array.Count > 0) { return Json(new { array, mqpath }, JsonRequestBehavior.AllowGet); } return Json("", JsonRequestBehavior.AllowGet); } } catch (Exception ex) { return Json("", JsonRequestBehavior.AllowGet); } }