Пример #1
0
 public override CompetingConsumerCommand Handle(CompetingConsumerCommand command)
 {
     try
     {
         // Let's simulate that some connection is failing and retry later
         if (Generator.Next(100) % 10 == 0)
         {
             throw new Exception("some exception occurred");
         }
         Console.WriteLine($"command number {command.CommandNumber}");
         _commandCounter.CountCommand();
         return(base.Handle(command));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw new DeferMessageAction();
     }
 }