Пример #1
0
        public static string GetExchangeType(ExchangeType exchangeType)
        {
            if (!_exchangeTypes.TryGetValue(exchangeType, out var type))
            {
                throw new ArgumentException($"exchange type {nameof(exchangeType)} does not exist");
            }

            return(type);
        }
Пример #2
0
        public Consumer(ConnectionAdapter connectionAdapter, string exchangeName = null, IEnumerable <RoutingKey> routingKeys = null, string queueName = null,
                        bool autoAcknowledge = true, bool autoStart = true, ExchangeType exchangeType = ExchangeType.Direct, ushort prefetchCount = 1)
        {
            _connectionAdapter = connectionAdapter;
            _exchangeName      = exchangeName;
            _routingKeys       = routingKeys;
            _autoAcknowledge   = autoAcknowledge;
            _queueName         = queueName;
            _exchangeType      = exchangeType;
            _prefetchCount     = prefetchCount;

            if (autoStart)
            {
                Start();
            }
        }