コード例 #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);
        }