示例#1
0
        public void StartListening()
        {
            _cancellationTokenSource = new CancellationTokenSource();

            Task.Factory.StartNew(async() =>
            {
                //Logging.Logger.Debug($"Listening to queue: {_queue.QueueName}");

                await _consumerFactory
                .For(_receiver, _cancellationTokenSource)
                .StartConsumingMessagesAsync();
            })
            .Unwrap()
            .ContinueWith(LogTaskEndState);
        }