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