예제 #1
0
파일: QueueFunc.cs 프로젝트: Sighmoon/Task2
 private void SettingsSetUp(QueueParams param)
 {
     queueName     = param.QueueName;
     hostName      = param.HostName;
     exchange      = param.Exchange;
     login         = param.Login;
     password      = param.Password;
     port          = param.Port;
     isDurable     = param.IsDurable;
     isAutoDelete  = param.IsAutoDelete;
     isExcuclusive = param.IsExcuclusive;
 }
예제 #2
0
파일: QueueFunc.cs 프로젝트: Sighmoon/Task2
        static public QueueObj GetQueueObj(QueueParams param)
        {
            var connectionParams = new ConnectionFactory {
                HostName = param.HostName
            };
            QueueObj Qobj = new QueueObj();

            Qobj.connection = connectionParams.CreateConnection();
            Qobj.channel    = Qobj.connection.CreateModel();
            Qobj.SettingsSetUp(param);
            Qobj.channel.QueueDeclare(param.QueueName, param.IsDurable, param.IsExcuclusive, param.IsAutoDelete, null);
            Qobj.channel.BasicQos(0, 1, false);
            return(Qobj);
        }