예제 #1
0
        /// <summary>
        /// 监听“付款数据”的队列
        /// </summary>
        /// <param name="mqManager"></param>
        /// <param name="config"></param>
        private static void MonitorPayData(MQServcieManager mqManager, MQConfig config)
        {
            MQQueueInfo mQQueueInfo11 = new MQQueueInfo()
            {
                QueueName    = MQManufacturerCode + "PayDataQueue.YunPark",
                RoutingKey   = "PayData4007004008",
                ExchangeType = RabbitMQ.Client.ExchangeType.Topic,
                ExchangeName = MQYunCameraExchange.TopicPushPayDataToYunParkExchange
            };

            IMQService mQService = new CreateMQService(config, mQQueueInfo11);

            mqManager.AddServices(mQService);
        }
예제 #2
0
        /// <summary>
        /// 监听“创建新地区”的队列
        /// </summary>
        /// <param name="manager"></param>
        /// <param name="config"></param>
        private static void MonitorNewParking(MQServcieManager mqManager, MQConfig config)
        {
            MQQueueInfo mQQueueInfo11 = new MQQueueInfo()
            {
                QueueName    = MQManufacturerCode + "NewCityCodeQueue",
                RoutingKey   = "NewCityCode4007004008",
                ExchangeType = RabbitMQ.Client.ExchangeType.Direct,
                ExchangeName = MQYunCameraExchange.DirectDynamicAddNewCityCode
            };

            IMQService mQService = new CreateMQService(config, mQQueueInfo11);

            mqManager.AddServices(mQService);
        }
예제 #3
0
        /// <summary>
        /// 初始化每个地区创建独立监听队列
        /// (区号 如:0755、0731)
        /// </summary>
        /// <param name="manager"></param>
        /// <param name="config"></param>
        private static void InitMonitorCityCode(MQServcieManager mqManager, MQConfig config, string cityCode)
        {
            //接收数据队列
            MQQueueInfo mQQueueInfo1 = new MQQueueInfo()
            {
                QueueName    = MQManufacturerCode + cityCode + "YunParkCameraQueue",
                RoutingKey   = cityCode,
                ExchangeType = RabbitMQ.Client.ExchangeType.Topic
            };

            IMQService mQService = new CreateMQService(config, mQQueueInfo1);

            mQService.Exchange = MQYunCameraExchange.TopicFuJiCaYunCameraParkPushExchange;
            mqManager.AddServices(mQService);
        }
예제 #4
0
        /// <summary>
        /// 动态创建地区监听队列
        /// </summary>
        /// <param name="mqManager"></param>
        /// <param name="config"></param>
        /// <param name="cityCode"></param>
        private static void DynamicAddMonitorCityCode(MQServcieManager mqManager, MQConfig config, string cityCode)
        {
            MQQueueInfo mQQueueInfo = new MQQueueInfo()
            {
                QueueName    = MQManufacturerCode + cityCode + "YunParkCameraQueue",
                RoutingKey   = cityCode,
                ExchangeType = RabbitMQ.Client.ExchangeType.Topic
            };

            IMQService mQService = new CreateMQService(config, mQQueueInfo);

            mQService.Exchange = MQYunCameraExchange.TopicFuJiCaYunCameraParkPushExchange;

            MQChannel m_MQChannel3 = new MQChannel(mQQueueInfo.ExchangeType, mQQueueInfo.ExchangeName, mQQueueInfo.QueueName, mQQueueInfo.RoutingKey);
            Dictionary <IMQService, MQChannel> IMQServiceAndMQChannel3 = new Dictionary <IMQService, MQChannel>();

            IMQServiceAndMQChannel3.Add(mQService, m_MQChannel3);

            mqManager.DynamicAddMQChannel.Enqueue(IMQServiceAndMQChannel3);
        }