コード例 #1
0
        public override bool LoadResources()
        {
            try
            {
                switch (QueueType.ToLower())
                {
                case "msmq":
                    //QueueType = "Logictracker.Messaging.MsmqQueue.MessageQueueMsmq , Logictracker.Messaging.MsmqQueue, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                    implementation = new MessageQueueMsmq();
                    break;

                case "rabbitmq":
                    QueueType      = "Logictracker.Messaging.RabbitmqQueue.MessageQueueRabbitMq,Logictracker.Messaging.RabbitmqQueue";
                    implementation = Activator.CreateInstance(Type.GetType(QueueType, true)) as IMessageQueueImplementation;
                    break;
                }
                if (implementation == null)
                {
                    throw new ArgumentException("QueueType invalid", "QueueType");
                }

                implementation.MessageQueue = this;

                return(implementation.LoadResources());
            }
            catch (Exception e)
            {
                STrace.Exception(typeof(IMessageQueue).FullName, e, String.Format("Error inicializando la cola '{0}'", QueueName));
                //        Handler = null;
                return(false);
            }
        }