示例#1
0
 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
        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);
        }