Ejemplo n.º 1
0
        public static void AddMQInfoList(MQInfo mq)
        {
            string key = mq.HostID + "&" + mq.ExchangeName + "&" + mq.ExchangeType + "&" + mq.QueueName + "&" + mq.RouteKey;

            if (mapMQInfo.ContainsKey(key) == false)
            {
                mapMQInfo.Add(key, null);
            }
            mapMQInfo[key] = mq;
        }
Ejemplo n.º 2
0
 public static bool BuildMQ(MQConfig config, MQInfo mq)
 {
     try
     {
         string key = config.HostUrl + "&" + config.Port + "&" + config.VirtualHost;
         mapChannel[key].ExchangeDeclare(mq.ExchangeName, mq.ExchangeType);     //声明交换机
         mapChannel[key].QueueDeclare(mq.QueueName, false, false, false, null); //声明一个队列
         mapChannel[key].QueueBind(mq.QueueName, mq.ExchangeName, mq.RouteKey);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
        public static void RegisterCline(ClineInfo cline, MQInfo mqInfo)
        {
            if (clineInfos.Any(x => x.ClineID == cline.ClineID) == false)
            {
                clineInfos.Add(cline);
            }
            string key = cline.ClineID + "&" + cline.ClineType + "&" + mqInfo.HostID;

            if (mapClineMapInfo.ContainsKey(key))
            {
                return;
            }
            var clineMapInfo = new ClineMapInfo()
            {
                MQID = mqInfo.MQID, ClineID = cline.ClineID, ClineType = cline.ClineType, MapStatus = 1
            };

            mapClineMapInfo.TryAdd(key, clineMapInfo);
        }
Ejemplo n.º 4
0
 public static void CancellationCline(ClineInfo cline, MQInfo mqInfo)
 {
 }