private Task CompleteCommand(ProcessingCommand processingCommand, CommandResult commandResult)
 {
     try
     {
         return(processingCommand.CompleteAsync(commandResult));
     }
     catch (Exception ex)
     {
         _logger.Error(string.Format("Failed to complete command, commandId: {0}, aggregateRootId: {1}", processingCommand.Message.Id, processingCommand.Message.AggregateRootId), ex);
         return(Task.CompletedTask);
     }
 }
Exemple #2
0
 public async Task CompleteMessage(ProcessingCommand message, CommandResult result)
 {
     try
     {
         if (_messageDict.TryRemove(message.Sequence, out ProcessingCommand removed))
         {
             LastActiveTime = DateTime.Now;
             await message.CompleteAsync(result).ConfigureAwait(false);
         }
     }
     catch (Exception ex)
     {
         _logger.Error(string.Format("{0} complete message with result failed, aggregateRootId: {1}, messageId: {2}, messageSequence: {3}, result: {4}", GetType().Name, AggregateRootId, message.Message.Id, message.Sequence, result), ex);
     }
 }