Esempio n. 1
0
        public override void HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, byte[] body)
        {
            Func <Task <bool> > func = () => ConsumeMessage(redelivered, deliveryTag, properties, body).ContinueWith(t =>
            {
                _errorSubscriber.UnhandledException(t.Exception);

                return(false);
            }, TaskContinuationOptions.OnlyOnFaulted);

            _taskFactory.StartNew(func).Unwrap();
        }
Esempio n. 2
0
 public override async Task HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, byte[] body)
 {
     try
     {
         await ConsumeMessage(redelivered, deliveryTag, properties, body);
     }
     catch (Exception ex)
     {
         _errorSubscriber.UnhandledException(ex);
     }
 }