Esempio n. 1
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();
            }
        }
Esempio n. 2
0
 public Service(ConnectionAdapter connectionAdapter)
 {
     _connectionAdapter = connectionAdapter;
     _consumer          = new Consumer(_connectionAdapter);
     _consumer.MessageReceivedHandler += OnMessageReceived;
 }
Esempio n. 3
0
 public Service(ConnectionAdapter connectionAdapter, string exchangeName, string queueName, bool autoAcknowledge)
 {
     _connectionAdapter = connectionAdapter;
     _consumer          = new Consumer(_connectionAdapter, exchangeName, GetRoutingKeys(), queueName, autoAcknowledge);
     _consumer.MessageReceivedHandler += OnMessageReceived;
 }