示例#1
0
        public ProducterInfo GetProducterInfo(DbConn PubConn, string mqpath,string productername)
        {
            ProducterInfo r = new ProducterInfo();
            tb_mqpath_dal mqpathdal = new tb_mqpath_dal();
            r.MqPathModel = mqpathdal.Get(PubConn,mqpath);
            if (r.MqPathModel == null)
                throw new BusinessMQException(string.Format("当前mqpath:{0}未在MQ中注册队列,请联系管理员注册成功后使用。",mqpath));
            tb_mqpath_partition_dal mqpathpartitiondal = new tb_mqpath_partition_dal();
            r.MqPathParitionModel = mqpathpartitiondal.GetList(PubConn,r.MqPathModel.id);
            if (r.MqPathParitionModel == null||r.MqPathParitionModel.Count==0)
                throw new BusinessMQException(string.Format("当前mqpath:{0}未在MQ中分配相应的分区,请联系管理员分配分区后使用。", mqpath));

            //注册生产者
            r.ProducterModel = this.RegisterProducter(PubConn, r.MqPathModel.id, productername);
            //获取分区相关节点
            List<int> datanodepartition = new List<int>();
            foreach (var p in r.MqPathParitionModel)
            {
                var partitionidinfo = PartitionRuleHelper.GetPartitionIDInfo(p.partitionid);
                if (!datanodepartition.Contains(partitionidinfo.DataNodePartition))
                    datanodepartition.Add(partitionidinfo.DataNodePartition);
            }
            r.DataNodeModelDic = this.GetDataNodeModelsDic(PubConn, datanodepartition);

            return r;
        }
示例#2
0
文件: BaseBLL.cs 项目: xwx2015/MQ
 public tb_mqpath_model GetMqPathModel(DbConn PubConn, string mqpath)
 {
     tb_mqpath_dal mqpathdal = new tb_mqpath_dal();
     var mqpathmodel = mqpathdal.Get(PubConn, mqpath);
     if (mqpathmodel == null)
         throw new BusinessMQException("当前队列不存在:" + mqpath);
     return mqpathmodel;
 }
示例#3
0
文件: ConsumerBLL.cs 项目: xwx2015/MQ
 public DateTime? GetLastUpdateTimeOfMqPath(DbConn PubConn, string mqpath)
 {
     tb_mqpath_dal mqpathdal = new tb_mqpath_dal();
     return mqpathdal.GetLastUpdateTimeOfMqPath(PubConn, mqpath);
 }