Ejemplo n.º 1
0
        public RabbitMQQueue(Uri uri, IRabbitMQConfiguration configuration)
        {
            Guard.AgainstNull(uri, nameof(uri));
            Guard.AgainstNull(configuration, nameof(configuration));

            _parser = new RabbitMQUriParser(uri);

            Uri = _parser.Uri;

            if (_parser.Priority != 0)
            {
                _arguments.Add("x-max-priority", (int)_parser.Priority);
            }

            _configuration = configuration;

            _operationRetryCount = _configuration.OperationRetryCount;

            if (_operationRetryCount < 1)
            {
                _operationRetryCount = 3;
            }

            _factory = new ConnectionFactory
            {
                UserName           = _parser.Username,
                Password           = _parser.Password,
                HostName           = _parser.Host,
                VirtualHost        = _parser.VirtualHost,
                Port               = _parser.Port,
                RequestedHeartbeat = configuration.RequestedHeartbeat
            };
        }
Ejemplo n.º 2
0
        public RabbitMQQueue(Uri uri, IRabbitMQConfiguration configuration)
        {
            Guard.AgainstNull(uri, "uri");
            Guard.AgainstNull(configuration, "configuration");

            _parser = new RabbitMQUriParser(uri);

            Uri = _parser.Uri;

            _configuration = configuration;

            _operationRetryCount = _configuration.OperationRetryCount;

            if (_operationRetryCount < 1)
            {
                _operationRetryCount = 3;
            }

            _factory = new ConnectionFactory
            {
                UserName           = _parser.Username,
                Password           = _parser.Password,
                HostName           = _parser.Host,
                VirtualHost        = _parser.VirtualHost,
                Port               = _parser.Port,
                RequestedHeartbeat = configuration.RequestedHeartbeat
            };
        }
Ejemplo n.º 3
0
        public Channel(IModel model, RabbitMQUriParser parser, IRabbitMQConfiguration configuration)
        {
            Guard.AgainstNull(model, "model");
            Guard.AgainstNull(parser, "parser");
            Guard.AgainstNull(configuration, "configuration");

            Model = model;

            _queue = parser.Queue;

            _millisecondsTimeout = parser.Local
                                ? configuration.LocalQueueTimeoutMilliseconds
                                : configuration.RemoteQueueTimeoutMilliseconds;
        }