Beispiel #1
0
        public static MSMQAgent GetMSMQAgent(string mqPath)
        {
            MSMQAgent agent = null;

            try
            {
                agent = new MSMQAgent(mqPath);
            }
            catch { }
            return(agent);
        }
        protected void InitReceiver(string mqPath)
        {
            _MQAgent = MSMQAgent.GetMSMQAgent(mqPath);

            if (_MQAgent == null || _MQAgent.GetQueue() == null)
            {
                throw new Exception("Init receiver failed.");
            }

            if (_MQAgent.GetQueue() == null)
            {
                throw new Exception("Init receiver's queue failed.");
            }
        }