Ejemplo n.º 1
0
        /// <summary>
        /// 关闭连接
        /// </summary>
        public void Close()
        {
            IMessageProducer _mqProducer = null;

            foreach (var item in this.MQProducerDic)
            {
                if (MQProducerDic.TryGetValue(item.Key, out _mqProducer))
                {
                    _mqProducer?.Close();
                }
            }
            MQProducerDic.Clear();
            if (MQSession != null)
            {
                MQSession.Close();
            }
            if (MQCnnection != null)
            {
                MQCnnection.Close();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 关闭连接
 /// </summary>
 public void Close()
 {
     MQConsumer?.Close();
     MQSession?.Close();
     MQCnnection?.Close();
 }