/// <summary> /// 根据交换机获取消息队列信息 /// </summary> /// <param name="exchange">交换机</param> /// <returns>消息队列信息</returns> public RabbitMessageQueueInfo ReaderByExchange(string exchange) { return(GetMessagQueueInfoByCondition(x => { return RabbitUtil.IsTwoExchangeEqual(exchange, x.Exchange); })); }
/// <summary> /// 根据交换机获取消息队列信息 /// </summary> /// <param name="exchange">交换机</param> /// <param name="virtualPath">虚拟路径</param> /// <returns>消息队列信息</returns> public RabbitMessageQueueInfo ReaderByExchange(string exchange, string virtualPath = RabbitConnectionInfo.DEFAULT_VIRTUAL_PATH) { var extend = ConfigUtil.CreateContainerVirtualPathDic(virtualPath); return(GetMessagQueueInfoByCondition(x => { return RabbitUtil.IsTwoExchangeEqual(exchange, x.Exchange); }, extend)); }
/// <summary> /// 根据交换机和队列获取消息队列信息 /// </summary> /// <param name="exchange">交换机</param> /// <param name="queue">队列</param> /// <returns>消息队列信息</returns> public RabbitMessageQueueInfo ReaderByExchangeAndQueue(string exchange, string queue) { if (string.IsNullOrWhiteSpace(exchange) || string.IsNullOrWhiteSpace(queue)) { return(null); } return(GetMessagQueueInfoByCondition(x => { return RabbitUtil.IsTwoExchangeEqual(exchange, x.Exchange) && queue.Equals(x.Queue); })); }
/// <summary> /// 根据交换机和队列获取消息队列信息 /// </summary> /// <param name="exchange">交换机</param> /// <param name="queue">队列</param> /// <param name="virtualPath">虚拟路径</param> /// <returns>消息队列信息</returns> protected RabbitMessageQueueInfo ReaderByExchangeAndQueue(string exchange, string queue, string virtualPath = RabbitConnectionInfo.DEFAULT_VIRTUAL_PATH) { if (string.IsNullOrWhiteSpace(exchange) || string.IsNullOrWhiteSpace(queue)) { return(null); } var extend = ConfigUtil.CreateContainerVirtualPathDic(virtualPath); return(GetMessagQueueInfoByCondition(x => { return RabbitUtil.IsTwoExchangeEqual(exchange, x.Exchange) && queue.Equals(x.Queue); }, extend)); }
/// <summary> /// 根据交换机获取消息队列信息 /// </summary> /// <param name="exchange">交换机</param> /// <param name="allList">所有列表</param> /// <returns>消息队列信息</returns> public static RabbitMessageQueueInfo ReaderByExchange(string exchange, IList <RabbitMessageQueueInfo> allList) { if (allList.IsNullOrCount0()) { return(null); } foreach (RabbitMessageQueueInfo item in allList) { if (RabbitUtil.IsTwoExchangeEqual(exchange, item.Exchange)) { return(item); } } return(null); }
/// <summary> /// 根据交换机获取消息队列信息 /// </summary> /// <param name="exchange">交换机</param> /// <returns>消息队列信息</returns> public RabbitMessageQueueInfo ReaderByExchange(string exchange) { IList <RabbitMessageQueueInfo> list = dicCaches.Count == 0 ? ReaderAll() : dicCaches.ValuesToList(); if (list.IsNullOrCount0()) { return(null); } foreach (RabbitMessageQueueInfo item in list) { if (RabbitUtil.IsTwoExchangeEqual(exchange, item.Exchange)) { return(item); } } return(null); }