OnCallbackException() public method

public OnCallbackException ( RabbitMQ.Client.Events.CallbackExceptionEventArgs args ) : void
args RabbitMQ.Client.Events.CallbackExceptionEventArgs
return void
 protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer)
 {
     try
     {
         await consumer.HandleBasicDeliver(_consumerTag,
                                           _deliveryTag,
                                           _redelivered,
                                           _exchange,
                                           _routingKey,
                                           _basicProperties,
                                           _body.Memory.Slice(0, _bodyLength)).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         var details = new Dictionary <string, object>()
         {
             { "consumer", consumer },
             { "context", "HandleBasicDeliver" }
         };
         model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
     }
     finally
     {
         _body.Dispose();
     }
 }
Esempio n. 2
0
 protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer)
 {
     try
     {
         await consumer.HandleBasicDeliver(_consumerTag,
                                           _deliveryTag,
                                           _redelivered,
                                           _exchange,
                                           _routingKey,
                                           _basicProperties,
                                           _body).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         var details = new Dictionary <string, object>()
         {
             { "consumer", consumer },
             { "context", "HandleBasicDeliver" }
         };
         model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
     }
     finally
     {
         if (MemoryMarshal.TryGetArray(_body, out ArraySegment <byte> segment))
         {
             ArrayPool <byte> .Shared.Return(segment.Array);
         }
     }
 }
Esempio n. 3
0
 public void HandleBasicConsumeOk(IBasicConsumer consumer,
                                  string consumerTag)
 {
     UnlessShuttingDown(() =>
     {
         try
         {
             consumer.HandleBasicConsumeOk(consumerTag);
         }
         catch (Exception e)
         {
             var details = new Dictionary <string, object>()
             {
                 { "consumer", consumer },
                 { "context", "HandleBasicConsumeOk" }
             };
             model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
         }
     });
 }
Esempio n. 4
0
 protected override async Task Execute(ModelBase model, IBasicConsumer consumer)
 {
     try
     {
         await consumer.HandleModelShutdown(model, reason).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         var details = new Dictionary <string, object>()
         {
             { "consumer", consumer },
             { "context", "HandleModelShutdown" }
         };
         await model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
     }
 }
 protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer)
 {
     try
     {
         await consumer.HandleBasicCancelOk(_consumerTag).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         var details = new Dictionary <string, object>()
         {
             { "consumer", consumer },
             { "context", "HandleBasicCancelOk" }
         };
         model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
     }
 }
Esempio n. 6
0
 protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer)
 {
     try
     {
         await consumer.HandleBasicDeliver(consumerTag,
                                           deliveryTag,
                                           redelivered,
                                           exchange,
                                           routingKey,
                                           basicProperties,
                                           body).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         var details = new Dictionary <string, object>()
         {
             { "consumer", consumer },
             { "context", "HandleBasicDeliver" }
         };
         model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
     }
 }