コード例 #1
0
 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();
     }
 }
コード例 #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);
         }
     }
 }
コード例 #3
0
 protected override Task Execute(IAsyncBasicConsumer consumer)
 {
     return(consumer.HandleBasicDeliver(_consumerTag,
                                        _deliveryTag,
                                        _redelivered,
                                        _exchange,
                                        _routingKey,
                                        _basicProperties,
                                        _body));
 }
コード例 #4
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));
     }
 }