コード例 #1
0
ファイル: Consumer.cs プロジェクト: KyleMillsSE/Self
        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();
            }
        }
コード例 #2
0
ファイル: Service.cs プロジェクト: KyleMillsSE/Self
 public Service(ConnectionAdapter connectionAdapter)
 {
     _connectionAdapter = connectionAdapter;
     _consumer          = new Consumer(_connectionAdapter);
     _consumer.MessageReceivedHandler += OnMessageReceived;
 }
コード例 #3
0
ファイル: Service.cs プロジェクト: KyleMillsSE/Self
 public Service(ConnectionAdapter connectionAdapter, string exchangeName, string queueName, bool autoAcknowledge)
 {
     _connectionAdapter = connectionAdapter;
     _consumer          = new Consumer(_connectionAdapter, exchangeName, GetRoutingKeys(), queueName, autoAcknowledge);
     _consumer.MessageReceivedHandler += OnMessageReceived;
 }