예제 #1
0
        private void StartDequeue()
        {
            DequeueTask = Task.Run(() =>
            {
                var assistant = new ReceptionAssistant <TMessage>(HostId, QueueName, _cts.Token);

                try
                {
                    var provider = QueueProviderFactory.CreateProvider(_provider);
                    provider.Dequeue <TMessage>(assistant, Pooling);
                }
                catch (Exception ex)
                {
                    LogFactory.GetLogger().Error(string.Format("Receive Task Error for queue \"{0}\".", assistant.QueueName), ex);
                }
            }, _cts.Token);

            ConsumerHealth.Register(this);
        }
예제 #2
0
 public QueueProducer(QueueProvider provider)
 {
     IgnoreHash = false;
     _provider  = QueueProviderFactory.CreateProvider(provider);
 }